php-general Digest 10 Dec 2009 15:27:50 -0000 Issue 6480

Topics (messages 300357 through 300358):

Re: SimpleXML or DOMDocument help
        300357 by: Michael Alaimo

I have not seen any messages for a couple of days...
        300358 by: Jay Blanchard

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
> Michael Alaimo wrote:
>> Hello All,
>>
>> I have an XML document that has elements as such:
>>         <Query:Expression>
>>           <Query:ResourceID>
>>             <Query:Equal>Test/Query:Equal>
>>           </Query:ResourceID>
>>         </Query:Expression>
>>
>>
>> I cannot figure out how to access these with simple xml.  I am not
>> opposed
>> to a DOMDocument solution either.
>>
>> Would anyone know what to do in this case?  I think the problem is the
>> :.
>>
>> Regards,
>>
>> Mike
>>
>>

>
> What's the entire XML document?  You need a xmlns declaration as Query
> is a namespace.
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
>

I was able to solve this by using
$ns = $xml->getNamespaces(true);
foreach ($xml->children($ns['Query']) as $Query) {
  echo $Query->Where;
}

Thanks for the help Shawn.

Mike



--- End Message ---
--- Begin Message ---
...is this thing on?

--- End Message ---

Reply via email to