Hi Axelle, xsi:schemaLocation attributes have a fairly straightforward syntax, actually: it's simply a series of whitespace-separated pairs, each pair consisting of first, the targetNamespace of the schema being located, the second being some "hint" as to where to find it. Ideally, the hint should be in the form of an absolute file uri (e.g., file:///home/myDir/my.xsd), but Xerces will try and resolve relative URI's as best it can. For an example of this, see the personal-schema.xml shipped with the samples.
You'll also need to be sure to turn on schema validation and namespace support; the API docs have a couple of ways to do that. Hope that helps (sorry; in a bit of a huery so not as detailed as I'd like). Cheers, Neil Neil Graham XML Parser Development IBM Toronto Lab Phone: 905-413-3519, T/L 969-3519 E-mail: [EMAIL PROTECTED] |---------+-----------------------------> | | "Axelle Apvrille | | | (LMC)" | | | <[EMAIL PROTECTED]| | | ricsson.ca> | | | | | | 02/21/2003 04:32 | | | PM | | | Please respond to | | | xerces-c-dev | | | | |---------+-----------------------------> >---------------------------------------------------------------------------------------------------------------------------------------------| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Schema validation & location question with DOM Parser. | | | | | >---------------------------------------------------------------------------------------------------------------------------------------------| Hi all, I'd like to validate my (small) XML document against my (small ;-)) XML schema. I've seen multiple posts in the archives of this mailing-list + the DOMPrinter sample, but I must admit I am quite confused... I can't get it quite to work, nor do I really understand exactly what's going on. I managed to get my source code do some validation, but it complains about schema location "Message: The schemaLocation attribute does not contain pairs of values"... and as a matter of fact, I'm unsure how to tell him where my schema is. - there doesn't seem to be any validation against my schema unless I specify Val_Schemes::Val_Always ? By the way I do have implemented my own ErrorHandler to catch the errors. - do I need to call setExternalSchemaLocation() to set where to find my schema, or should it be set in the XML Schema, or does it need to be at both places ? or should I rather use noNamespaceSchemaLocation in the XML document ? Thanks Axelle. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]