By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,483 Members | 1,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,483 IT Pros & Developers. It's quick & easy.

Xpath and simplexml

100+
P: 132
I have this result when i do var_dump to $xml

Expand|Select|Wrap|Line Numbers
  1. `object(SimpleXMLElement)[257]
  2.   public '@attributes' => 
  3.     array (size=1)
  4.       'seq' => string '290' (length=3)
  5.   public 'FIN' => 
  6.     object(SimpleXMLElement)[256]
  7.       public '@attributes' => 
  8.         array (size=1)
  9.           'seq' => string '261' (length=3)
  10.       public 'VAL' => string '1' (length=1)
  11.       public 'ATT' => 
  12.         array (size=11)
  13.           0 => 
  14.             object(SimpleXMLElement)[255]`
i need select with simplexml which seq have value 290

i do that
Expand|Select|Wrap|Line Numbers
  1. $seq=$xmlglobtech->xpath("//GROUP[@seq='290']/FIN/REM")
i do var_dump($seq) i have that

no anything array(size=0) empty


Thanks in advance
Jun 11 '15 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
you say that the dump is from $xml, but the code shows an XPath request to $xmlglobtech.

additionally, the SimpleXML object dump you showed is incomplete.

the SimpleXML object you showed does not contain a <GROUP> element (as required per XPath).

the SimpleXML object you showed looks like it is the targeted <GROUP> element, but is does not contain a <REM> element, though that may be due to the incomplete dump.
Jun 11 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.