You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by "Gagnon, Joseph - 0553 - MITLL" <Jo...@ll.mit.edu> on 2015/05/05 15:28:19 UTC

XML schema information for DOM documents?

I see that the various parser classes have the means to specify XML schema
information for validation purposes, etc.  When I parsed an XML file with
schema information specified I was able to see a fair amount of
schema-specific information from the node (xercesc::DOMNode) object (e.g.
namespace URI, prefix).  If I do not include the schema information, much of
that information is missing (as one might expect).

 

Now, if I'm building a document (xercesc::DOMDocument) I'm not finding any
similar methods to specify any schema information.  If I were to serialize
the document to XML, wouldn't the resulting XML not have any schema
information?  How do I get schema-specific information into a DOM document
being built?

 

In addition to the case described for serialization to XML, I also have the
need to traverse and parse a DOM document and use the information not only
about the elements, attributes, etc. but also will need schema-specific
information (prefixes, namespaces).  Since the DOMNode object can contain
this information, it was my intention to use that as the source.  However,
if I cannot inject schema information into the document and retrieve it
later, that presents me with a problem.

 

Is there a way to build a DOM document such that it has XML schema
information "built in"?

 

Thanks,

Joe Gagnon

 

Engineer II

Group 58 - Cyber Systems & Technology

MIT Lincoln Laboratory

Lexington, MA