Overview
Features
Download
Documentation
Community
Add-Ons & Services

XML Output

Please post support and help requests here.

XML Output

Postby TheRawGod » 07 Dec 2006, 15:54

Hello,

working with Poco these days I faced another problem. In the form of the question it sonds: is it possible to produce an XML output omitting all "namespace"-related stuff? I processed and HTML page and was a problem: the browser refuses HTML code that contains namespaces, especially when they occur in the middle of the document that is the case when I want to process just the part of the HTML page, let's say its body. The only solution I found was to do it manually, using Poco's base classes but that does not seem to be an easy approach:(


Another issue is that there is no way to output the "innerHTML" (MS JScript DOM terminology) contents of the XML element. This is not a real problem, as it's always possible to combine output of element's children, though when every of those children contain namespace declarations it is a problem:)
TheRawGod
 
Posts: 6
Joined: 06 Dec 2006, 13:33
Location: Ukraine

Re: XML Output

Postby guenter » 08 Dec 2006, 10:11

Both DOMParser and SAXParser support a member function setFeature(), which you can use to turn off namespaces support:

Example:

POCO::XML::DOMParser parser;
parser.setFeature("http://xml.org/sax/features/namespaces", false);
...
guenter
 
Posts: 1135
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: XML Output

Postby TheRawGod » 08 Dec 2006, 14:56

Thanks a lot!

I found that feature to be able to be set for XMLReader, but not for DOMParser as that was not very obvios for me... Thanks again for bringing light on that.
TheRawGod
 
Posts: 6
Joined: 06 Dec 2006, 13:33
Location: Ukraine


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest