Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Problem with nested elements with the same names #6

Open
dandys71 opened this issue Oct 19, 2020 · 0 comments
Open

Problem with nested elements with the same names #6

dandys71 opened this issue Oct 19, 2020 · 0 comments

Comments

@dandys71
Copy link

dandys71 commented Oct 19, 2020

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant