473,385 Members | 1,275 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Xpath and simplexml

132 100+
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
1 5005
Dormilich
8,658 Expert Mod 8TB
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

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

Similar topics

1
by: Joshua Beall | last post by:
Hi All, I have a task that should be very simple but I'm running into trouble. All I want to do is query a document using XPath, and save the resulting XML in a string. Here's that I am trying...
1
by: hwcowan | last post by:
Hello, I have started using SimpleXML and can do most things, but there are a couple of things that I can't seem to figure out. Currently, I can: 1. Open & load an XML file 2. Manually...
4
by: sugoi.sama | last post by:
hi, i'm having a hellish adventure with PHP5 i hope someone just can help me out on this... i'm desperate All i want to do, is to get the index of the returned elements, so i can acess them...
2
by: mouseit101 | last post by:
Hi, I'm writing a script that would (hopefully) search google images for whatever, and then return a list of URLs for the image. Right now I have: $dom = new DomDocument(); $url =...
2
by: Weston | last post by:
Poking around with XPath using SimpleXML, it looks like there are at least a few reasonably common XPath operators and predicates that aren't supported. I'd like to check my observations against...
1
by: WebCM | last post by:
There are lots of problems with XHTML parsing in PHP by XML functions. I've just solved most of them. However, how to get value of attribute with namespace? <input type="checkbox" id="something"...
7
by: dimo414 | last post by:
So I'm trying to use SimpleXML to get some attribute information about some nodes in my XML document, but it seems like SimpleXML ignores attributes for elements with no children, For instance:...
1
by: Phillip B Oldham | last post by:
I'm sure I'll soon figure out how to find these things out for myself, but I'd like to get the community's advice on something. I'm going to throw together a quick project over the weekend: a...
0
by: agam | last post by:
Hello, I have a php code that can find a child node in my xml file, And my problem is that I want to delete the specific user when I find the child node. How can I implement it here? ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.