Re: [xsl] Validate Doc XML with XML Schema

Subject: Re: [xsl] Validate Doc XML with XML Schema
From: "Eder de Oliveira" <eder@xxxxxxxxxxxxx>
Date: Thu, 17 Feb 2005 11:33:06 -0300

I am using the exemple:

// create a SchemaFactory that conforms to W3C XML Schema
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

 // set your error handler to catch errors during schema construction

 // parse the purchase order schema
 Schema schema = sf.newSchema("po.xsd");

 // get a DOM factory
 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

 // configure the factory

 // set schema on the factory

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

 // parse and validate against po.xsd an XML document
 Document purchaseOrderDoc = db.parse("po.xml");

I have a problem:
// set schema on the factory
My DocumentBuilderFactory haven't "setSchema".

I'm using j2sk 1.4

Can I help me please?


----- Original Message ----- From: "Michael Kay" <mike@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, February 17, 2005 9:53 AM
Subject: RE: [xsl] Validate Doc XML with XML Schema

Off-topic for this list, but see the following article on JAXP 1.3:

Saxon-SA 8.3 supports the JAXP 1.3 schema validation API, and includes
further examples of its use.

Michael Kay

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

Current Thread