Answer the question
In order to leave comments, you need to log in
xpath getting attribute
There is an xml like
TITLE
<test:test1>TEST</test:test1>
<test:test2 at:attr="attribute">TEST2</test:test2>
How to get TITLE, TEST and TEST2 is not a question.
TITLE is obtained simply, TEST and TEST2 via
$xml->xpath('//test:test1');
but how to get at:attr and "attribute" via xpath? Or at least an attribute? As I understand it, you need to get it through @ but it doesn’t work like this //test:[email protected]:attr
Please tell me who is familiar with xpath
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question