Skip to content

Reparse element with same reader #280

Open
@Zekfad

Description

@Zekfad

I'm in process of writing annotation (php 8.3) based (de)serialize methods and thinking about how to implement polymorphic node (select in xsd).

While it's possible to make an educated guess, meaning analyze candidate structures and try to see which one xml is actually follows, I think that solution is overly complicated to get it right.

I think of a try-catch parsing every candidate until first match. But to do so I need a way to reparse element with current reader options.

I'm thinking about cloning reader options to a new one and use fragment to get a stable copy of element descendants. Is there any better or convenient ways to achieve it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions