/** * Checks the correctness of the XML Schema documents and return true * if it's OK. * * <p> * This method performs a weaker version of the tests where error messages * are provided without line number information. So whenever possible * use {@link SchemaConstraintChecker}. * * @see SchemaConstraintChecker */ public boolean checkSchemaCorrectness(ErrorReceiver errorHandler) { try { SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI); ErrorReceiverFilter filter = new ErrorReceiverFilter(errorHandler); sf.setErrorHandler(filter); Set<String> roots = getRootDocuments(); Source[] sources = new Source[roots.size()]; int i=0; for (String root : roots) { sources[i++] = new DOMSource(get(root),root); } sf.newSchema(sources); return !filter.hadError(); } catch (SAXException e) { // the errors should have been reported return false; } }
/** * Checks the correctness of the XML Schema documents and return true * if it's OK. * * <p> * This method performs a weaker version of the tests where error messages * are provided without line number information. So whenever possible * use {@link SchemaConstraintChecker}. * * @see SchemaConstraintChecker */ public boolean checkSchemaCorrectness(ErrorReceiver errorHandler) { try { SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI); ErrorReceiverFilter filter = new ErrorReceiverFilter(errorHandler); sf.setErrorHandler(filter); Set<String> roots = getRootDocuments(); Source[] sources = new Source[roots.size()]; int i=0; for (String root : roots) { sources[i++] = new DOMSource(get(root),root); } sf.newSchema(sources); return !filter.hadError(); } catch (SAXException e) { // the errors should have been reported return false; } }
for( String systemId : getRootDocuments() ) { Document dom = get(systemId); if (dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
for( String systemId : getRootDocuments() ) { Document dom = get(systemId); if (dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
for( String systemId : getRootDocuments() ) { Document dom = get(systemId); if (dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
/** * Parses a {@link DOMForest} into a {@link XSSchemaSet}. * * @return * null if the parsing failed. */ public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException { // set up other parameters to XSOMParser XSOMParser reader = createXSOMParser(forest); // re-parse the transformed schemas for (String systemId : forest.getRootDocuments()) { errorReceiver.pollAbort(); Document dom = forest.get(systemId); if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) reader.parse(systemId); } XSSchemaSet result = reader.getResult(); if(result!=null) scdBasedBindingSet.apply(result,errorReceiver); return result; }
for( String systemId : getRootDocuments() ) { Document dom = get(systemId); if (dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
for( String systemId : getRootDocuments() ) { Document dom = get(systemId); if (dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
/** * Parses a {@link DOMForest} into a {@link XSSchemaSet}. * * @return * null if the parsing failed. */ public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException { // set up other parameters to XSOMParser XSOMParser reader = createXSOMParser(forest); // re-parse the transformed schemas for (String systemId : forest.getRootDocuments()) { errorReceiver.pollAbort(); Document dom = forest.get(systemId); if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) reader.parse(systemId); } XSSchemaSet result = reader.getResult(); if(result!=null) scdBasedBindingSet.apply(result,errorReceiver); return result; }
ErrorReceiverFilter filter = new ErrorReceiverFilter(errorHandler); sf.setErrorHandler(filter); Set<String> roots = getRootDocuments(); Source[] sources = new Source[roots.size()]; int i=0;
/** * Parses a {@link DOMForest} into a {@link XSSchemaSet}. * * @return * null if the parsing failed. */ public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException { // set up other parameters to XSOMParser XSOMParser reader = createXSOMParser(forest); // re-parse the transformed schemas for (String systemId : forest.getRootDocuments()) { errorReceiver.pollAbort(); Document dom = forest.get(systemId); if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) { reader.parse(systemId); } } XSSchemaSet result = reader.getResult(); if(result!=null) scdBasedBindingSet.apply(result,errorReceiver); return result; }
/** * Parses a {@link DOMForest} into a {@link XSSchemaSet}. * * @return * null if the parsing failed. */ public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException { // set up other parameters to XSOMParser XSOMParser reader = createXSOMParser(forest); // re-parse the transformed schemas for (String systemId : forest.getRootDocuments()) { errorReceiver.pollAbort(); Document dom = forest.get(systemId); if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) { reader.parse(systemId); } } XSSchemaSet result = reader.getResult(); if(result!=null) scdBasedBindingSet.apply(result,errorReceiver); return result; }
/** * Parses a {@link DOMForest} into a {@link XSSchemaSet}. * * @return * null if the parsing failed. */ public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException { // set up other parameters to XSOMParser XSOMParser reader = createXSOMParser(forest); // re-parse the transformed schemas for (String systemId : forest.getRootDocuments()) { errorReceiver.pollAbort(); Document dom = forest.get(systemId); if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) { reader.parse(systemId); } } XSSchemaSet result = reader.getResult(); if(result!=null) scdBasedBindingSet.apply(result,errorReceiver); return result; }
ErrorReceiverFilter filter = new ErrorReceiverFilter(errorHandler); sf.setErrorHandler(filter); Set<String> roots = getRootDocuments(); Source[] sources = new Source[roots.size()]; int i=0;
ErrorReceiverFilter filter = new ErrorReceiverFilter(errorHandler); sf.setErrorHandler(filter); Set<String> roots = getRootDocuments(); Source[] sources = new Source[roots.size()]; int i=0;