468,514 Members | 1,636 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

Parsing XSD Schema from namespace schemaLocation using Xerces CDT

Hi,

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
accordingly.
Anybody some idea or some sample code how to realize this?

Best Regards,
Chris

Nov 21 '06 #1
1 2821
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
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.