Hi Lauren,

For validating a document with a specified schema see
http://xml.apache.org/xerces2-j/faq-grammars.html

If you have the schema document as a String in memory then you can very easily feed that to the parser. The parser needs an InputSource and that does not require a file, you can set directly a Reader that can be a StringReader created over the String that represents your schema.

Hope that helps,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Lauren Bish wrote:
While people are thinking about XSD, is there a way to have Xerces validate an XML blob using an in memory definition of an XSD?

I surfed around in the JavaDocs and didn't see any obvious way of constructing an XSD on the fly, and handing it to Xerces to use to validate an XML blob. The closest I could find was SchemaGrammar.

Excuse me if this obvious to others, it just isn't to me as I am new to XML, XSD and Xerces. If there are any examples of how to do this I would appreciate a link.

Thanks.


---------------------------------------------------------------------
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]

Reply via email to