Subject: Re: [xsl] Validate Doc XML with XML Schema From: "Eder de Oliveira" <eder@xxxxxxxxxxxxx> Date: Thu, 17 Feb 2005 11:33:06 -0300 |
// set your error handler to catch errors during schema construction sf.setErrorHandler(myErrorHandler);
// parse the purchase order schema Schema schema = sf.newSchema("po.xsd");
// get a DOM factory DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
// configure the factory dbf.setNamespaceAware(true);
// set schema on the factory dbf.setSchema(schema);
// create a new parser that validates documents against // the schema specified (po.xsd) DocumentBuilder db = dbf.newDocumentBuilder();
// attach an error handler to detect document validation errors db.setErrorHandler(myErrorHandler);
// parse and validate against po.xsd an XML document Document purchaseOrderDoc = db.parse("po.xml");
I have a problem: // set schema on the factory dbf.setSchema(schema); My DocumentBuilderFactory haven't "setSchema".
Thanks Eder
Off-topic for this list, but see the following article on JAXP 1.3:
https://jaxp.dev.java.net/article/jaxp-1_3-article.html
Saxon-SA 8.3 supports the JAXP 1.3 schema validation API, and includes further examples of its use.
Michael Kay http://www.saxonica.com/
-----Original Message----- From: Eder de Oliveira [mailto:eder@xxxxxxxxxxxxx] Sent: 17 February 2005 13:23 To: XSL - list Subject: [xsl] Validate Doc XML with XML Schema
Hi People,
Please, Anyone can help me!
I would like validate a doc XML using XML Schema in JAVA and parser SAX
Have any samples ?
Thanks a lot Eder
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Validate Doc XML with XML, Michael Kay | Thread | [xsl] Replace function and apostrop, Andrew Welch |
[xsl] Validate Doc XML with XML Sch, Eder de Oliveira | Date | [xsl] Replace function and apostrop, Andrew Welch |
Month |