[xsd-users] bug in examples/cxx/tree/custom/comments/dom-parse.cxx
Erik Sjölund
erik.sjolund at gmail.com
Sat Sep 7 09:13:11 EDT 2013
If you patch the example custom/comments with the attached file patch.txt
the comment
<!--Record for Joe Dirt-->
from the original file people.xml will be preserved in the output from this
command:
$ ./driver people.xml
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ppl:catalog xmlns:ppl="http://www.codesynthesis.com/people" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.codesynthesis.com/people people.xsd">
<person>
<!--Record for Joe Dirt-->
<name>Joe Dirt</name>
<age>29</age>
</person>
<person>
<!--Record for John Doe-->
<name>John Doe</name>
<age>30</age>
</person>
</ppl:catalog>
The example source code makes more sense this way, I think.
cheers
Erik Sjölund
-------------- next part --------------
--- xsd-4.0.0.a12-x86_64-linux-gnu/examples/cxx/tree/custom/comments/dom-parse.cxx 2009-11-05 05:44:29.000000000 +0100
+++ xsd-4.0.0.a12-x86_64-linux-gnu.new/examples/cxx/tree/custom/comments/dom-parse.cxx 2013-09-07 14:57:10.986011322 +0200
@@ -41,7 +41,7 @@
// Discard comment nodes in the document.
//
- conf->setParameter (XMLUni::fgDOMComments, false);
+ conf->setParameter (XMLUni::fgDOMComments, true);
// Enable datatype normalization.
//
@@ -92,7 +92,7 @@
xml::dom::auto_ptr<DOMBuilder> parser (
impl->createDOMBuilder (DOMImplementationLS::MODE_SYNCHRONOUS, 0));
- parser->setFeature (XMLUni::fgDOMComments, false);
+ parser->setFeature (XMLUni::fgDOMComments, true);
parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true);
parser->setFeature (XMLUni::fgDOMEntities, false);
parser->setFeature (XMLUni::fgDOMNamespaces, true);
More information about the xsd-users
mailing list