Can I ignore XSD schema file while using Xerces Lib in C++?

237 views Asked by At

I am using Xerces 3.1.1 lib in C++, and trying to read an XML file using DOM. I use DOMLSParser for parsing the xml file.

Everything works perfectly fine when I provide both the XSD schema file (using loadGrammar()), and XML file (using parse()).

The problem is that the whitespaces in XML file are reported if I don't provide the XSD file. It corrupts the output since each carriage return, whitespace etc is reported as a textnode. If I provide the XSD file I can set the flag to false

(XMLUni::fgDOMElementContentWhitespace,false)

What I want to do instead is I want to skip the validation part against a XSD file. If I parse an XML file, it shouldn't report whitespaces/

To summarize the requirement: 1- Without using an XSD file, can I ignore whitespaces using the parser? 2- Can I skip XSD Schema file validation altogether?

Thanks.

0

There are 0 answers