[Home] [By Thread] [By Date] [Recent Entries]
Hello!
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 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". I'm using j2sk 1.4 Can I help me please? Thanks Eder ----- Original Message ----- From: "Michael Kay" <mike@xxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Thursday, February 17, 2005 9:53 AM Subject: RE: Validate Doc XML with XML Schema Off-topic for this list, but see the following article on JAXP 1.3:
|

Cart



