Skip to content

Problem with nested elements with the same names #6

@dandys71

Description

@dandys71

Hello,

I got problem with elements which are nested and have the same name. For example on given XML:
<ITEM> <NAME>Basic item</NAME> <VALUE>10</VALUE> <TYPES> <TYPE> <NAME>Black</NAME> </TYPE> <TYPE> <NAME>White</NAME> </TYPE> </TYPES> </ITEM>

I had set up the parser end tag to ITEM:
$parser->setEndTag('ITEM');

When I want to access to value of NAME the given result isn't just "Basic item", but "Basic Item Black White". What I should do to ignore the nested elements value? But I also need to access data of the nested elements (so I can't use setIgnoreTags(['TYPES']))? It will be ok for me if the data will be separated somehow for example with semicolon, (Basic item;Black;White). Is it possible?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions