473,394 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 3048
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ole Hedegaard | last post by:
Hi, I've been looking into the Xerces documentation, and to my surprise it seems that it is impossible to validate an XML document againts an XML Schema without having a schemaLocation (or...
1
by: Duncan Smith | last post by:
Hello All, Has anyone found a way to specify an xsd schema programatically when using the apache xerces xml processor? I know that the validation works fine as long as the xml instance document...
2
by: Olaf Meyer | last post by:
Apprentently xerces 2.6.0 (Java) does not validate against contraints specified in the schema (e.g. constraints specified via unique element). The validation works with the XML editor I'm using...
0
by: kyancy | last post by:
Hello All. We have several XML schemas to describe common component document parts. We then create new XML schemas as necessary that use "xsd:import schemaLocation=whateverLocation.." to include...
2
by: pohmart | last post by:
I am using Xerces 2.6.2 and SAX on Windows2k. I want to validate an XML doc, which has no schema reference, with an external schema which is on my PC. I am setting the following properties and...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
4
by: Iain A. Mcleod | last post by:
Hi I'm stuck with the following schema validation problem in VS.NET 2003: I have two types of xml document and related schema: project and projectCollection. A projectcollection is just a set...
8
by: pradeepsarathy | last post by:
Hi all, Does the SAX parser has eventhandlers for parsing xml schema. Can we parse the xml schema the same way as we parse the xml document using SAX Parser. Thanks in advance. -pradeep
0
by: mk189 | last post by:
Hi, I am trying to create XML schema of custom markup language, enriched by XHTML. In simplified version, the XML documet could look like that: <a:alarm-manual xmlns:a="alarm-manual"...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.