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