There is a bug in Xerces 2.6.x which causes the external schema location 
properties to be ignored if the values of features/properties do not 
change between parses. This has been fixed for a while now in CVS.

Without a schema location another way to locate your schema is with an 
entity resolver. The entity resolvers in XNI and DOM Level 3 will both 
receive the schema's target namespace (if it has one). If the location of 
the schema varies you may want to use XML Catalogs [1].

[1] http://xml.apache.org/xerces2-j/faq-xcatalogs.html

"Nathan Beyer" <[EMAIL PROTECTED]> wrote on 12/05/2004 01:05:08 PM:

> Assuming you're using a relatively new version of the parser, you should 
be
> able to use the JAXP 1.2 XML Schema properties, see [1] for examples. 
You'll
> need to make sure you set the parser to "validating".
> 
> If you're using the Xerces features, I believe you need to explicitly 
enable
> XML Schema validation [2], in addition to just the validation feature 
[3].
> 
> -Nathan
> 
> [1] http://java.sun.com/xml/jaxp/change-requests-12.html
> [2] http://xml.apache.org/xerces2-j/features.html#validation.schema
> [3] http://xml.apache.org/xerces2-j/features.html#validation
> 
> 
> -----Original Message-----
> From: Michael Woinoski [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, December 05, 2004 8:04 AM
> To: [EMAIL PROTECTED]
> Subject: validating documents (SOAP messages) with no schemaLocation
> attribute
> 
> For security purposes, I need to validate documents (incoming SOAP 
messages)
> 
> using a schema. The messages do not contain a schemaLocation attribute. 
The 
> elements in the message are defined with namespaces, so the 
> noNamespaceSchemaLocation attribute isn't appropriate. And adding
> schemaLocation 
> using DOM requires parsing the message without validation, which is what 
I'm
> 
> trying to avoid.
> 
> Is there any way to use a schema to validate a document without adding a 

> schemaLocation attribute to the document? The externalSchemaLocation
> property 
> seems to work only if the document already contains a schemaLocation
> attribute.
> 
> Thanks,
> Mike
> 
> 
> ---------------------------------------------------------------------
> 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]
>

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]


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

Reply via email to