XmlSchema read(InputSource inputSource, ValidationEventHandler veh, TargetNamespaceValidator namespaceValidator) { try { DocumentBuilderFactory docFac = DocumentBuilderFactory.newInstance(); docFac.setNamespaceAware(true); DocumentBuilder builder = docFac.newDocumentBuilder(); Document doc = builder.parse(inputSource); return read(doc, inputSource.getSystemId(), veh, namespaceValidator); } catch (ParserConfigurationException e) { throw new XmlSchemaException(e.getMessage()); } catch (IOException e) { throw new XmlSchemaException(e.getMessage()); } catch (SAXException e) { throw new XmlSchemaException(e.getMessage()); } }
XmlSchema read(final InputSource inputSource, ValidationEventHandler veh, TargetNamespaceValidator namespaceValidator) { try { DocumentBuilderFactory docFac = DocumentBuilderFactory.newInstance(); docFac.setNamespaceAware(true); final DocumentBuilder builder = docFac.newDocumentBuilder(); /* specify ER on doc builder */ if (entityResolver != null) builder.setEntityResolver(entityResolver); Document doc = null; doc = parse_doPriv(inputSource, builder, doc); return read(doc, inputSource.getSystemId(), veh, namespaceValidator); } catch (ParserConfigurationException e) { throw new XmlSchemaException(e.getMessage()); } catch (IOException e) { throw new XmlSchemaException(e.getMessage()); } catch (SAXException e) { throw new XmlSchemaException(e.getMessage()); } }
XmlSchema read(final InputSource inputSource, ValidationEventHandler veh, TargetNamespaceValidator namespaceValidator) { try { DocumentBuilderFactory docFac = DocumentBuilderFactory.newInstance(); docFac.setNamespaceAware(true); final DocumentBuilder builder = docFac.newDocumentBuilder(); Document doc = null; doc = parse_doPriv(inputSource, builder, doc); return read(doc, inputSource.getSystemId(), veh, namespaceValidator); } catch (ParserConfigurationException e) { throw new XmlSchemaException(e.getMessage()); } catch (IOException e) { throw new XmlSchemaException(e.getMessage()); } catch (SAXException e) { throw new XmlSchemaException(e.getMessage()); } }
public void validate(XmlSchema pSchema) { final boolean valid; if (isEmpty(uri)) { valid = isEmpty(pSchema.syntacticalTargetNamespace); } else { valid = pSchema.syntacticalTargetNamespace.equals(uri); } if (!valid) { throw new XmlSchemaException("An imported schema was announced to have the namespace " + uri + ", but has the namespace " + pSchema.syntacticalTargetNamespace); } } };
public void validate(XmlSchema pSchema) { if (isEmpty(pSchema.syntacticalTargetNamespace)) { pSchema.logicalTargetNamespace = schema.logicalTargetNamespace; } else { if (!pSchema.syntacticalTargetNamespace.equals(schema.logicalTargetNamespace)) { String msg = "An included schema was announced to have the default target namespace"; if (!isEmpty(schema.logicalTargetNamespace)) { msg += " or the target namespace " + schema.logicalTargetNamespace; } throw new XmlSchemaException(msg + ", but has the target namespace " + pSchema.logicalTargetNamespace); } } } };
public void validate(XmlSchema pSchema) { final boolean valid; if (isEmpty(uri)) { valid = isEmpty(pSchema.syntacticalTargetNamespace); } else { valid = uri.equals(pSchema.syntacticalTargetNamespace); } if (!valid) { throw new XmlSchemaException( "An imported schema was announced to have the namespace " + uri + ", but has the namespace " + pSchema.syntacticalTargetNamespace); } } };
public void validate(XmlSchema pSchema) { final boolean valid; if (isEmpty(uri)) { valid = isEmpty(pSchema.syntacticalTargetNamespace); } else { valid = pSchema.syntacticalTargetNamespace.equals(uri); } if (!valid) { throw new XmlSchemaException( "An imported schema was announced to have the namespace " + uri + ", but has the namespace " + pSchema.syntacticalTargetNamespace); } } };
public void validate(XmlSchema pSchema) { if (isEmpty(pSchema.syntacticalTargetNamespace)) { pSchema.logicalTargetNamespace = schema.logicalTargetNamespace; } else { if (!pSchema.syntacticalTargetNamespace .equals(schema.logicalTargetNamespace)) { String msg = "An included schema was announced to have the default target namespace"; if (!isEmpty(schema.logicalTargetNamespace)) { msg += " or the target namespace " + schema.logicalTargetNamespace; } throw new XmlSchemaException(msg + ", but has the target namespace " + pSchema.logicalTargetNamespace); } } } };
public void addType(XmlSchemaType type) { QName qname = type.getQName(); if (schemaTypes.contains(qname)) { throw new XmlSchemaException(" Schema for namespace '" + syntacticalTargetNamespace + "' already contains type '" + qname.getLocalPart() + "'"); } schemaTypes.add(qname, type); }
public void validate(XmlSchema pSchema) { if (isEmpty(pSchema.syntacticalTargetNamespace)) { pSchema.logicalTargetNamespace = schema.logicalTargetNamespace; } else { if (!pSchema.syntacticalTargetNamespace .equals(schema.logicalTargetNamespace)) { String msg = "An included schema was announced to have the default target namespace"; if (!isEmpty(schema.logicalTargetNamespace)) { msg += " or the target namespace " + schema.logicalTargetNamespace; } throw new XmlSchemaException(msg + ", but has the target namespace " + pSchema.logicalTargetNamespace); } } } };
public void addType(XmlSchemaType type) { QName qname = type.getQName(); if (schemaTypes.contains(qname)) { throw new XmlSchemaException(" Schema for namespace '" + syntacticalTargetNamespace + "' already contains type '" + qname.getLocalPart() + "'"); } schemaTypes.add(qname, type); }
throw new XmlSchemaException("Unable to locate imported document " + "at '" + schemaLocation + "'" + (baseUri == null in.setByteStream(ins); } catch (IOException e) { throw new XmlSchemaException("Unable to load imported document " + "at '" + schemaLocation + "'" + (baseUri == null
throw new XmlSchemaException("Unable to locate imported document " + "at '" + schemaLocation + "'" + (baseUri == null in.setByteStream(ins); } catch (IOException e) { throw new XmlSchemaException("Unable to load imported document " + "at '" + schemaLocation + "'" + (baseUri == null
facet = new XmlSchemaWhiteSpaceFacet(); } else { throw new XmlSchemaException("Incorrect facet with name \"" + name + "\" found.");
facet = new XmlSchemaWhiteSpaceFacet(); } else { throw new XmlSchemaException("Incorrect facet with name \"" + name + "\" found.");
public Document[] getAllSchemas() { try { XmlSchemaSerializer xser = new XmlSchemaSerializer(); xser.setExtReg(this.parent.getExtReg()); return xser.serializeSchema(this, true); } catch (XmlSchemaSerializer.XmlSchemaSerializerException e) { throw new XmlSchemaException(e.getMessage()); } }
public Document[] getAllSchemas() { try { XmlSchemaSerializer xser = new XmlSchemaSerializer(); xser.setExtReg(this.parent.getExtReg()); return xser.serializeSchema(this, true); } catch (XmlSchemaSerializer.XmlSchemaSerializerException e) { throw new XmlSchemaException(e.getMessage()); } }
public Document[] getAllSchemas() { try { XmlSchemaSerializer xser = new XmlSchemaSerializer(); xser.setExtReg(this.parent.getExtReg()); return xser.serializeSchema(this, true); } catch (XmlSchemaSerializer.XmlSchemaSerializerException e) { throw new XmlSchemaException(e.getMessage()); } }
new XmlSchemaCollection.SchemaKey(this.logicalTargetNamespace, systemId); if (parent.containsSchema(schemaKey)) { throw new XmlSchemaException("Schema name conflict in collection"); } else { parent.addSchema(schemaKey, this);
new XmlSchemaCollection.SchemaKey(this.logicalTargetNamespace, systemId); if (parent.containsSchema(schemaKey)) { throw new XmlSchemaException("Schema name conflict in collection"); } else { parent.addSchema(schemaKey, this);