Re: [PHP] simplexml - can it do what I need?

[email protected] (Carlos Medina)
Newsgroups php.general
Organization SimplyNetworks
Message-ID <[email protected]>
TerryA schrieb:
> Hi Shawn
> Thanks for answering my query. I have looked at the suggestions:
> 
> $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA);
> 
> I am/was able to load the file OK and to access the data by iteration.
> However, I can't find a way to extract data by attributes. I need something
> like $string=<element idtype="11" lang="fr" label="Description - Etage">.
> Obviously, that won't work but that's the result I need. How do I get the
> data out of one of these elements by specifying its idtype and lang? I've
> google for hours on this and for another hour on SimpleXMLElement.
> 
> Terry
Hi Terry,
look at the PHP.NET documentation. There indicates the use of 
simpleXMLElement structures. If you want to extract elements from this 
object, please read there how this work. By the way, it would be 
interesting to see, how your XML is made. May be is usefull to use 
another class like DOM.

regards

carlos


http://de2.php.net/manual/fr/book.simplexml.php
http://de2.php.net/manual/fr/refs.xml.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.