private void initializeSchemas() { if (!schemasAreInitialized) { HashSet schemas = new HashSet(); Iterator xmlDescriptors; XMLDescriptor xmlDescriptor; XMLSchemaReference xmlSchemaReference; int numberOfSessions = xmlContext.getSessions().size(); for (int x = 0; x < numberOfSessions; x++) { xmlDescriptors = ((DatabaseSession)xmlContext.getSessions().get(x)).getDescriptors().values().iterator(); URL schemaURL; while (xmlDescriptors.hasNext()) { xmlDescriptor = (XMLDescriptor)xmlDescriptors.next(); xmlSchemaReference = xmlDescriptor.getSchemaReference(); if (null != xmlSchemaReference) { schemaURL = xmlSchemaReference.getURL(); if (null != schemaURL) { schemas.add(schemaURL.toString()); } } } } schemas.remove(null); platformUnmarshaller.setSchemas(schemas.toArray()); schemasAreInitialized = true; } }
private void initializeSchemas() { if (!schemasAreInitialized) { HashSet schemas = new HashSet(); Iterator xmlDescriptors; XMLDescriptor xmlDescriptor; XMLSchemaReference xmlSchemaReference; int numberOfSessions = ((XMLContext) context).getSessions().size(); for (int x = 0; x < numberOfSessions; x++) { xmlDescriptors = ((CoreSession)context.getSessions().get(x)).getDescriptors().values().iterator(); URL schemaURL; while (xmlDescriptors.hasNext()) { xmlDescriptor = (XMLDescriptor)xmlDescriptors.next(); xmlSchemaReference = xmlDescriptor.getSchemaReference(); if (null != xmlSchemaReference) { schemaURL = xmlSchemaReference.getURL(); if (null != schemaURL) { schemas.add(schemaURL.toString()); } } } } schemas.remove(null); platformUnmarshaller.setSchemas(schemas.toArray()); schemasAreInitialized = true; } }
private void initializeSchemas() { if (!schemasAreInitialized) { HashSet schemas = new HashSet(); Iterator xmlDescriptors; XMLDescriptor xmlDescriptor; XMLSchemaReference xmlSchemaReference; int numberOfSessions = ((XMLContext) context).getSessions().size(); for (int x = 0; x < numberOfSessions; x++) { xmlDescriptors = ((CoreSession)context.getSessions().get(x)).getDescriptors().values().iterator(); URL schemaURL; while (xmlDescriptors.hasNext()) { xmlDescriptor = (XMLDescriptor)xmlDescriptors.next(); xmlSchemaReference = xmlDescriptor.getSchemaReference(); if (null != xmlSchemaReference) { schemaURL = xmlSchemaReference.getURL(); if (null != schemaURL) { schemas.add(schemaURL.toString()); } } } } schemas.remove(null); platformUnmarshaller.setSchemas(schemas.toArray()); schemasAreInitialized = true; } }
public boolean isValid(Document document, ErrorHandler errorHandler) { try { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); return xmlPlatform.validateDocument(document, getURL(), errorHandler); } catch (XMLPlatformException e) { if (e.getErrorCode() == XMLPlatformException.XML_PLATFORM_PARSER_ERROR_RESOLVING_XML_SCHEMA) { throw XMLMarshalException.errorResolvingXMLSchema(e); } else { return false; } } }
public boolean isValid(Document document, ErrorHandler errorHandler) { try { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); return xmlPlatform.validateDocument(document, getURL(), errorHandler); } catch (XMLPlatformException e) { if (e.getErrorCode() == XMLPlatformException.XML_PLATFORM_PARSER_ERROR_RESOLVING_XML_SCHEMA) { throw XMLMarshalException.errorResolvingXMLSchema(e); } else { return false; } } }
public boolean isValid(Document document, ErrorHandler errorHandler) { try { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); return xmlPlatform.validateDocument(document, getURL(), errorHandler); } catch (XMLPlatformException e) { if (e.getErrorCode() == XMLPlatformException.XML_PLATFORM_PARSER_ERROR_RESOLVING_XML_SCHEMA) { throw XMLMarshalException.errorResolvingXMLSchema(e); } else { return false; } } }