Xerces validator doesn’t work with saxon9
Added by Anonymous over 16 years ago
Legacy ID: #4918202 Legacy Poster: cristobal sepulveda (cristobalsr)
Hi! I was doing a Xerces validation with SaxParser. It worked fine with saxo 6, but when I try to use saxo9 for XSLT 2.0, my validator doesn’t work. Thank you
Replies (5)
Please register to reply
RE: Xerces validator doesn’t work with saxon9 - Added by Anonymous over 16 years ago
Legacy ID: #4918255 Legacy Poster: Michael Kay (mhkay)
If you want help with this problem, you will need to say exactly what you did and exactly how it failed. Saying that something "didn't work" is no use to anyone.
RE: Xerces validator doesn’t work with saxon9 - Added by Anonymous over 16 years ago
Legacy ID: #4918295 Legacy Poster: cristobal sepulveda (cristobalsr)
Sorry, The next code works with saxon 6, but not with saxon 9 (open source): ------------------------------------------------------------- ByteArrayOutputStream os = new ByteArrayOutputStream(); Transformer tr = TransformerFactory.newInstance().newTransformer(); tr.transform(doc, new StreamResult(os)); XMLReader xreader = XMLReaderFactory.createXMLReader(cParserXerces); xreader.setFeature( cValidation, true ); xreader.setFeature( cValidationSchema,true ); xreader.setFeature( cNamespaces, true ); xreader.setFeature( cNamespacePrefix, true ); xreader.setFeature( cFullCheckSchema, true ); xreader.setFeature( cContinuaFaltalError, true ); xreader.setFeature( cDinamicValidation, false ); xreader.setProperty( cSchemaLenguage, Constants.W3C_XML_SCHEMA_NS_URI); xreader.setEntityResolver(new CatalogResolver()); ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray()); if (ch != null) xreader.setContentHandler(ch); if (eh != null) xreader.setErrorHandler(eh); xreader.parse(new InputSource(is)); ------------------------------------------------------------- I get the next problem: cvc-elt.1: Cannot find the declaration of element 'declaracion'. 'declaration' is a tag name. I think the parser can't find the schema.
RE: Xerces validator doesn’t work with saxon9 - Added by Anonymous over 16 years ago
Legacy ID: #4918407 Legacy Poster: Michael Kay (mhkay)
I can't see what this has to do with Saxon: you're running a Saxon transformation (presumably) followed by a Xerces validation, and the only connection between them is a byte array containing a document to be validated. So what does the document in the byte array look like? Is it valid or isn't it? Is it different between Saxon6 and Saxon9? If the document is different between the two cases then let's see some details of the transformation. You seem to be expecting me to debug this with my eyes shut... Michael Kay http://www.saxonica.com/
RE: Xerces validator doesn’t work with saxon9 - Added by Anonymous over 16 years ago
Legacy ID: #4918417 Legacy Poster: David Lee (daldei)
This is definately a typeo ... but if its a typo in the source document it could explain everything: 'declaracion' != 'declaration'
RE: Xerces validator doesn’t work with saxon9 - Added by Anonymous over 16 years ago
Legacy ID: #4918441 Legacy Poster: cristobal sepulveda (cristobalsr)
OK. Let me prepare a full example, so you can debug this problem. Thank you
Please register to reply