[EMAIL PROTECTED] wrote:

Hi Axelle,

Hi Neil,
Thanks for your reply... but I've not yet managed to get it working.
The problem is that the personal-schema.xml sample is using noNamespaceSchemaLocation and not SchemaLocation. In my case, the parser keeps on complaining "The schemaLocation attribute does not contain pairs of values" ...


Also, is writing schemaLocation in the XML an alternative to setting setExternalSchemaLocation() ?

And why won't I have any validation unless I specify Val_Schemes::Val_Always ?


Here's the output of my sample test: Constructing a DOM Buffer Parser Constructing an Update Policy event Creating a sample XML document to parse <?xml version='1.0' encoding='ascii'?> <dsi:UpdatePolicy xmlns='http://www.w3.org/2001/XMLSchema' xmlns:dsi='http://xxx' dsi:schemaLocation='http://xxx UpdatePolicy.xsd'> <PolicyFile> /etc/toto.txt </PolicyFile> </dsi:UpdatePolicy>

Parsing the document
Fatal Error at file "XMLBuffer", line 4, column 68
 Message: The schemaLocation attribute does not contain pairs of values.
Missing Policy tag in XML event
Free everything
EXIT

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]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to