Re: XML and :

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 24, 2009 at 9:51 AM, Merlin Morgenstern
<merlin_x@xxxxxxxxxxx> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux