471,084 Members | 797 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,084 software developers and data experts.

Parsing XSD Schema from namespace schemaLocation using Xerces CDT


I have a general question regarding the parsing of XSD files,
referenced within the namespace using Apache Xerces 2.7.0 (CDT). My
current c++ application can parse and validate an XML file and an XSD
schema, both located on my harddisk, against each other without any
problems. I can therefore also parse the schema file and access it the
same way than a common xml file.
The question now is whether Xerces provides the possibility to parse a
schema file that is just references within the namespace declaration
into a DOMDocument for example so that my application can not just
validate both files against each other but it should be able to parse
the entire schema instance as I need to analyze subsections of the xsd
Anybody some idea or some sample code how to realize this?

Best Regards,

Nov 21 '06 #1
1 2899
I'm not sure what you mean by "a schema file that is just references
within the namespace declaration". Namespace URIs are not guaranteed to
be the URI of the schema file which describes the document, which is why
there are separate mechanisms for associating namespaces with schemas.

Parsing a schema into a DOM document is reasonably straightforward once
you have the URIs of the schema files; just point an XML parser at the
schema URIs. Alternatively, you may want to check whether your parser
supports a schema-specific API (Xerces does), or the DOM Level 3 schema
model (I think Xerces does), which is a less-portable approach but which
makes retrieving useful information from the schema somewhat easier.

() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Nov 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ole Hedegaard | last post: by
4 posts views Thread by Iain A. Mcleod | last post: by
8 posts views Thread by pradeepsarathy | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.