Re: XML and :

From: Date: Tue, 24 Feb 2009 15:00:25 +0000
Subject: Re: XML and :
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-288738@lists.php.net to get a copy of this message
On Tue, Feb 24, 2009 at 9:51 AM, Merlin Morgenstern <merlin_x@fastmail.fm> wrote: > Hi there, > > I am trying to pars an XML file with php. This works if the xml tag looks > like this: <anbieternr>88</anbieternr> > In that case I retrieve the info: $xml->anbieternr > > But now the tag looks different like this: > <imo:anbieternr>88</imo:anbieternr> > > The command $xml->imo:anbieternr does not work in that case. > > Has somebody an idea how to adress this? > > Thank you for any help! > > Merlin > Short answer? You probably need to look at using XPath queries in SimpleXML to get to those elements. Shorter answer? If you have to deal with namespaces in documents, it's probably time for the project to graduate from SimpleXML to something like DOM. Look at the user note on this page: http://us3.php.net/manual/en/intro.simplexml.php Andrew

« previous php.general (#288738) next »