Re: Problem with XML Document parsing

RĂ©mi <[email protected]> Tue, 20 Dec 2005 22:51:23 +0100
Newsgroups gmane.linux.upnp-sdk.general
Message-ID <[email protected]>
Markus Wolters wrote:

> I have the discovery and subscription part working, but something went 
> wrong
> with my action response. The action result only has the browse tag with
> correct symbols. In between the symbols were replaced by strings and I 
> can't
> navigate through it with the node/document/element functions.
>  
>
can you clarify what you mean by "symbols" ?
The result you provide seems a valid fragment. You have to get the value 
of the <Result> node, which is itself a (properly escaped) XML fragment, 
then parse this string (e.g. with ixmlParseBuffer), in order to extract 
the DIDL-Lite document. You can then access the elements in this new 
document.


> The result:
>
> <Result>&lt;DIDL-Lite 
> xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
> xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot;
> xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;
> &lt;container id=&quot;1&quot; parentID=&quot;0&quot;
> childCount=&quot;7&quot; restricted=&quot;1&quot;
> searchable=&quot;1&quot;&gt;&lt;dc:title&gt;Music&lt;/dc:title&gt;&lt;dc:date&gt;&lt;/dc:date&gt;&lt;upnp:artist&gt;&lt;/upnp:artist&gt;&lt;upnp:genre&gt;&lt;/upnp:genre&gt;&lt;res 
>
> duration=&quot;00:00:00&quot; 
> protocolInfo=&quot;http-get:*:audio/x-mpegurl:*&quot;&gt;http://192.168.1.2:9001/m3u/1.m3u&lt;/res&gt;&lt;upnp:class&gt;object.container.musicContainer&lt;/upnp:class&gt;&lt;/container&gt; 
>
> &lt;container id=&quot;12&quot; parentID=&quot;0&quot;
> childCount=&quot;3&quot; restricted=&quot;1&quot;
> searchable=&quot;1&quot;&gt;&lt;dc:title&gt;Pictures&lt;/dc:title&gt;&lt;dc:date&gt;&lt;/dc:date&gt;&lt;upnp:class&gt;object.container&lt;/upnp:class&gt;&lt;/container&gt; 
>
> &lt;container id=&quot;16&quot; parentID=&quot;0&quot;
> childCount=&quot;2&quot; restricted=&quot;1&quot; 
> searchable=&quot;1&quot;&
>
>  
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click