Re: Using honour-all-schemaLocations feature in Xerces-j - 2.8.1
Vito Caleandro [EMAIL PROTECTED] wrote on 12/05/2006 09:30:55 AM: Hi all, in a SOAP-message validation I set the parser feature honour-all-schemaLocations of Xerces parser as follows: ... xmlvalidate failonerror=no warn=yes classname=org.apache.xerces.parsers.SAXParser file=D:\TestsRoot\AAGC\Reports\s1.xml classpath path=D:\JavaTools\xerces-2_8_1 location=xercesImpl.jar / attribute name=http://xml.org/sax/features/validation; value=true/ attribute name=http://apache.org/xml/features/validation/schema; value=true/ attribute name=http://xml.org/sax/features/namespaces; value=true/ attribute name=http://apache.org/xml/features/honour-all-schemaLocations; value=true/ property name=http://apache.org/xml/properties/schema/external-schemaLocation; value=http://schemas.xmlsoap.org/soap/envelope/ filepath...\envelope.xsd http://www.mynamespace.sgnaus filepath...\mySchema.xsd / /xmlvalidate ... but I got the message: BUILD FAILED D:\CanooWebTest\JobScripts\BLD_ValidaXML.xml:6: Parser org.apache.xerces.parsers.SAXParser doesn't recognize feature http://apache.org/xml/features/honour-all-schemaLocations Total time: 0 seconds So, the question that pops up: is a my mistake or some problem in Xerces ? Are you sure you don't have a much older copy of Xerces somewhere on your classpath like the one which came with whatever version of Ant you're using. Please, can anyone help me? Thanks in advance for any suggestion, Vito - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
EntityResolver problem while using SAX parser
Our XML file starts with : ourproj:rootXmlTag xmlns:ourproj=http://www.ourwebsite.com/ourproj; The XML schema corresponding to http://www.ourwebsite.com/ourproj is to be generated by our code from database. This is done by our own EntityResolver interface implementation. When we try to parse above file using SAX parser, we get error : Cannot find the declaration of element 'ourproj:rootXmlTag' and our EntityResolver class implementation's 'resolveEntity' method is not called ... Since we have multiple schemas and all are generated (not present at an URL), hence we cannot specify the xsi:schemaLocation attribute. Has anyone encountered this problem before ? --SD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: no such method XMLSchemaLoader.loadGrammar(XMLInputSource) ?
this problem seems to occur only when i use JDK1.4. i have the following system properties set, which i thought would make this go away, but unfortunately not... System.setProperty(org.xml.sax.driver, org.apache.xerces.parsers.SAXParser); System.setProperty(javax.xml.parsers.DocumentBuilderFactory, org.apache.xerces.jaxp.DocumentBuilderFactoryImpl); System.setProperty(javax.xml.transform.TransformerFactory, org.apache.xalan.processor.TransformerFactoryImpl); System.setProperty(javax.xml.parsers.SAXParserFactory, org.apache.xerces.jaxp.SAXParserFactoryImpl); System.setProperty(javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema;, org.apache.xerces.jaxp.validation.XMLSchemaFactory); any recommendation on making that issue go away? the exact error i'm getting is: java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Lorg/apache/xerces/xni/parser/XMLInputSource;)V using xerces, v.2.8.1 Michael Glavassevich wrote: Paul Tomsic [EMAIL PROTECTED] wrote on 10/03/2006 04:21:27 PM: v.2.8.1, trying to validate schemas on XML files. not sure where to start tracking down this issue? I've never seen this happen before. any help appreciated There isn't much to go on here. It's more likely someone will be able to help you if you provide more information: stack traces, environment, code, etc... thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/no-such-method-XMLSchemaLoader.loadGrammar%28XMLInputSource%29---tf2378514.html#a7709952 Sent from the Xerces - J - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: no such method XMLSchemaLoader.loadGrammar(XMLInputSource) ?
I am always using the endorsed arguments -Djava.endorsed.dirs to be sure I get the right xerces. Maybe this helps, DicK Deneer Op 5-dec-2006, om 23:49 heeft ptomsic het volgende geschreven: this problem seems to occur only when i use JDK1.4. i have the following system properties set, which i thought would make this go away, but unfortunately not... System.setProperty(org.xml.sax.driver, org.apache.xerces.parsers.SAXParser); System.setProperty(javax.xml.parsers.DocumentBuilderFactory, org.apache.xerces.jaxp.DocumentBuilderFactoryImpl); System.setProperty(javax.xml.transform.TransformerFactory, org.apache.xalan.processor.TransformerFactoryImpl); System.setProperty(javax.xml.parsers.SAXParserFactory, org.apache.xerces.jaxp.SAXParserFactoryImpl); System.setProperty(javax.xml.validation.SchemaFactory:http:// www.w3.org/2001/XMLSchema, org.apache.xerces.jaxp.validation.XMLSchemaFactory); any recommendation on making that issue go away? the exact error i'm getting is: java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Lorg/apache/ xerces/xni/parser/XMLInputSource;)V using xerces, v.2.8.1 Michael Glavassevich wrote: Paul Tomsic [EMAIL PROTECTED] wrote on 10/03/2006 04:21:27 PM: v.2.8.1, trying to validate schemas on XML files. not sure where to start tracking down this issue? I've never seen this happen before. any help appreciated There isn't much to go on here. It's more likely someone will be able to help you if you provide more information: stack traces, environment, code, etc... thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/no-such-method- XMLSchemaLoader.loadGrammar%28XMLInputSource%29--- tf2378514.html#a7709952 Sent from the Xerces - J - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: no such method XMLSchemaLoader.loadGrammar(XMLInputSource) ?
You're probably picking up an incompatible mix of classes from Xerces 2.8.1 and some old version of Xerces (something prior to 2.7.0) which is somewhere on your classpath or perhaps in the endorsed directory of your JDK 1.4 installation. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] ptomsic [EMAIL PROTECTED] wrote on 12/05/2006 05:49:14 PM: this problem seems to occur only when i use JDK1.4. i have the following system properties set, which i thought would make this go away, but unfortunately not... System.setProperty(org.xml.sax.driver, org.apache.xerces.parsers.SAXParser); System.setProperty(javax.xml.parsers.DocumentBuilderFactory, org.apache.xerces.jaxp.DocumentBuilderFactoryImpl); System.setProperty(javax.xml.transform.TransformerFactory, org.apache.xalan.processor.TransformerFactoryImpl); System.setProperty(javax.xml.parsers.SAXParserFactory, org.apache.xerces.jaxp.SAXParserFactoryImpl); System.setProperty(javax.xml.validation.SchemaFactory:http://www. w3.org/2001/XMLSchema, org.apache.xerces.jaxp.validation.XMLSchemaFactory); any recommendation on making that issue go away? the exact error i'm getting is: java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader. loadGrammar(Lorg/apache/xerces/xni/parser/XMLInputSource;)V using xerces, v.2.8.1 Michael Glavassevich wrote: Paul Tomsic [EMAIL PROTECTED] wrote on 10/03/2006 04:21:27 PM: v.2.8.1, trying to validate schemas on XML files. not sure where to start tracking down this issue? I've never seen this happen before. any help appreciated There isn't much to go on here. It's more likely someone will be able to help you if you provide more information: stack traces, environment, code, etc... thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/no-such-method- XMLSchemaLoader.loadGrammar%28XMLInputSource%29---tf2378514.html#a7709952 Sent from the Xerces - J - Users mailing list archive at Nabble.com. - 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]
EntityResolver problem while using SAX parser
Our XML file looks something like : ourproj:rootXmlTag xmlns:ourproj=http://www.ourwebsite.com/ourproj; ... The XML schema corresponding to http://www.ourwebsite.com/ourproj is to be generated by our code from database. This is done by our own EntityResolver implementation. When we try to parse above file using SAX parser, we get error : Cannot find the declaration of element 'ourproj:rootXmlTag' and our EntityResolver implementation's 'resolveEntity' method is not called ... Has anyone encountered this problem before ? --SD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]