Selecting peculiar XML tags with phpQuery

Posted by Aristotle on Stack Overflow See other posts from Stack Overflow or by Aristotle
Published on 2010-04-24T21:30:01Z Indexed on 2010/04/24 21:33 UTC
Read the original article Hit count: 240

Filed under:
|

phpQuery is a really nice tool which has helped me tremendously in the past parse well-formed XHTML and XML documents, but I have recently run into a problem trying to select elements that have colons in their tagname, such as the following:

<isc:thumb><![CDATA[http://example.com/foo_thumb.jpg]]></isc:thumb>

I've tried to use the pq() function to select all of these elements:

foreach ( pq("isc:thumb") as $thumbnail ) {
  print pq( $thumbnail )->text();
}

Unfortunately this is doing nothing. If I try another element, like a tagname of id, the results pop up as expected.

© Stack Overflow or respective owner

Related posts about phpquery

Related posts about Xml