Newsgroup: it.comp.java
Titolo: validazione xml

Salve,
devo validare un xml secondo alcuni schemi xsd
Utilizzo DOMParser settando in questo modo le Feature
d.setFeature("
http://xml.org/sax/features/validation
", true);
		    d.setFeature("
http://apache.org/xml/features/validation/schema
",
true);
		    d.setFeature("
http://apache.org/xml/features/validation/schema-
full-checking", true);
la validazione funziona, ho il seguente problema nel caso in cui non
ci sia la rete:
mi solleva questa eccezione:
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name
'xml:lang' to a(n) 'attribute declaration' component.
	at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(ErrorHandlerWrapper.java:236)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(ErrorHandlerWrapper.java:172)
	at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(XMLErrorReporter.java:382)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError
(XSDHandler.java:2241)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getGlobalDecl
(XSDHandler.java:1201)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDAttributeTraverser.traverseLocal
(XSDAttributeTraverser.java:122)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDAbstractTraverser.traverseAttrsAndAttrGrps
(XSDAbstractTraverser.java:516)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.processComplexContent
(XSDComplexTypeTraverser.java:1056)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexContent
(XSDComplexTypeTraverser.java:771)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexTypeDecl
(XSDComplexTypeTraverser.java:288)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseGlobal
(XSDComplexTypeTraverser.java:196)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas
(XSDHandler.java:1078)
	at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema
(XSDHandler.java:481)
	at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema
(XMLSchemaLoader.java:556)
	at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar
(XMLSchemaValidator.java:2459)
	at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement
(XMLSchemaValidator.java:1807)
	at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement
(XMLSchemaValidator.java:705)
	at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(XMLNSDocumentScannerImpl.java:330)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl
$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:
779)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDispatcher.dispatch
(XMLDocumentFragmentScannerImpl.java:1794)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(XMLDocumentFragmentScannerImpl.java:368)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(XML11Configuration.java:834)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(XML11Configuration.java:764)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse
(XMLParser.java:148)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse
(DOMParser.java:188)
	at enx.util.XMLSchemaValidator.validate(XMLSchemaValidator.java:58)
Il problema è che vorrei mi girasse anche in locale senza accesso alla
rete.
Dov'è secondo voi il problema?
Grazie

 Grazie
In genere errori del genere sono dovuti all'url dello schema dichiarato 
nel file xml.
Invece di usare un url http:// usa un url file:// indicando il percorso 
locale agli schemi, dtd o xsd che siano, nel file xml.
-- 
Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñejoAlcoolInside
Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'