0

I seem to be running into a problem. Considering the follow XML structure:

<data> <row> <id>1</id> <name>Peter</name> </row> <row> <id>2</id> <name>Ryan</name> </row> <row> <id>3</id> <name>Mike</name> </row> </data> 

It returns a SXE object named "data" which contains an array "row" which consists of more SXE objects.

I'm using XPath and I want to find the row which has "id = 2". But I don't think you can XPath your way through arrays, so what am I to do?

Edit: Oh, I found the answer. You CAN use XPath

$table->xpath('data/row[id=2]') 
0

1 Answer 1

1

Oh, I found the answer. You CAN use XPath

$table->xpath('data/row[id=2]') 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.