471,089 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Forcing schema validation

Does anyone know of a way to force validation of an XML file if the
schemaLocation attribute is not set in the document? For example, I'm
trying to use the loadGrammar() function of the xerces parser to force
it to validate foo.xml against foo.xsd, even though foo.xml does not
contain the schemaLocation attribute. The function returns OK, but
subsequent calls to parse() do not actually validate against the
grammar.

Nov 30 '06 #1
1 1213
Sanity check: Did you remember to turn on the schema validation Feature?
Xerces defaults to running in nonvalidating mode.
(http://xerces.apache.org/xerces2-j/features.html)

There are also Properties that control where schemas will be retrieved
from, which might be worth looking at
(http://xerces.apache.org/xerces2-j/properties.html)
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Nov 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by wumingshi | last post: by
1 post views Thread by Dan Bass | last post: by
2 posts views Thread by Ali | last post: by
1 post views Thread by billa1972 | last post: by
reply views Thread by Mark Parter | last post: by

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.