public static void checkAll() { // walk the tree of types StscState state = StscState.get(); List allSeenTypes = new ArrayList(); allSeenTypes.addAll(Arrays.asList(state.documentTypes())); allSeenTypes.addAll(Arrays.asList(state.attributeTypes())); allSeenTypes.addAll(Arrays.asList(state.redefinedGlobalTypes())); allSeenTypes.addAll(Arrays.asList(state.globalTypes())); for (int i = 0; i < allSeenTypes.size(); i++) { SchemaType gType = (SchemaType)allSeenTypes.get(i); if (!state.noPvr() && // option to turn off particle restriction checking !gType.isDocumentType()) // Don't check doc types for restriction. { checkRestriction((SchemaTypeImpl)gType); } checkFields((SchemaTypeImpl)gType); allSeenTypes.addAll(Arrays.asList(gType.getAnonymousTypes())); } checkSubstitutionGroups(state.globalElements()); }
if (name == null) if (type.isDocumentType())
if (sType.isDocumentType() || sType.isAttributeType() || sType == XmlObject.type) continue;
public Validator ( SchemaType type, SchemaField field, SchemaTypeLoader globalLoader, XmlOptions options, Collection defaultErrorListener ) { options = XmlOptions.maskNull(options); _errorListener = (Collection) options.get(XmlOptions.ERROR_LISTENER); _treatLaxAsSkip = options.hasOption(XmlOptions.VALIDATE_TREAT_LAX_AS_SKIP); _strict = options.hasOption(XmlOptions.VALIDATE_STRICT); if (_errorListener == null) _errorListener = defaultErrorListener; _constraintEngine = new IdentityConstraint(_errorListener, type.isDocumentType()); _globalTypes = globalLoader; _rootType = type; _rootField = field; _vc = new ValidatorVC(); }
private XmlObject newInstance(SchemaType type, XmlOptions options) { options = XmlOptions.maskNull(options); Cur c = tempCur(); SchemaType sType = (SchemaType) options.get(XmlOptions.DOCUMENT_TYPE); if (sType == null) sType = type == null ? XmlObject.type : type; if (sType.isDocumentType()) c.createDomDocumentRoot(); else c.createRoot(); c.setType(sType); XmlObject x = (XmlObject) c.getUser(); c.release(); return x; }
static QName findTopName(SchemaType sType) { if (sType.getName() != null) return sType.getName(); if (sType.isDocumentType()) { // A document type must have a content model consisting of a single elt if (sType.getContentModel() == null || sType.getContentModel().getParticleType() != SchemaParticle.ELEMENT) throw new IllegalStateException(); return (sType.getDocumentElementName()); } if (sType.isAttributeType()) { if (sType.getAttributeModel() == null || sType.getAttributeModel().getAttributes().length != 1) throw new IllegalStateException(); return sType.getAttributeTypeAttributeName(); } SchemaField sElt = sType.getContainerField(); assert(sElt != null); assert(sType.getOuterType() == null); return sElt.getName(); }
if (sType.isDocumentType())
public TypeStoreUser copy(SchemaTypeLoader stl, SchemaType type, XmlOptions options) { //do not use a user's Factory method for copying. //XmlFactoryHook hook = XmlFactoryHook.ThreadContext.getHook(); Xobj destination = null; options = XmlOptions.maskNull(options); SchemaType sType = (SchemaType) options.get(XmlOptions.DOCUMENT_TYPE); if (sType == null) sType = type == null ? XmlObject.type : type; Locale locale = this.locale(); if ( Boolean.TRUE.equals(options.get(XmlOptions.COPY_USE_NEW_SYNC_DOMAIN)) ) locale = Locale.getLocale(stl, options); if (sType.isDocumentType() || (sType.isNoType() && (this instanceof Xobj.DocumentXobj))) destination = Cur.createDomDocumentRootXobj(locale, false); else destination = Cur.createDomDocumentRootXobj(locale, true); locale.enter(); try { Cur c = destination.tempCur(); c.setType(type); c.release(); } finally { locale.exit(); } TypeStoreUser tsu = destination.copy_contents_from(this); return tsu; }
if (sType.isDocumentType()) else if (outerType.isDocumentType())
if (name == null) if (sType.isDocumentType()) name = sType.getDocumentElementName(); else if (sType.isAttributeType()) if (sType.isDocumentType()) emit(" * A document containing one " + prettyQName(name) + " element."); else if (sType.isAttributeType())
(requestedType == null || requestedType.isDocumentType())) if (type.isDocumentType()) verifyDocumentType(c, type.getDocumentElementName()); else if (type.isAttributeType())
else if (type.isDocumentType())
while (t.getOuterType() != null) t = t.getOuterType(); if (t.isDocumentType()) hasNS = t.getDocumentElementName().getNamespaceURI().length() > 0; else hasNS = t.getName().getNamespaceURI().length() > 0;
while (t.getOuterType() != null) t = t.getOuterType(); if (t.isDocumentType()) hasNS = t.getDocumentElementName().getNamespaceURI().length() > 0; else
public Validator ( SchemaType type, SchemaField field, SchemaTypeLoader globalLoader, XmlOptions options, Collection defaultErrorListener ) { options = XmlOptions.maskNull(options); _errorListener = (Collection) options.get(XmlOptions.ERROR_LISTENER); _treatLaxAsSkip = options.hasOption(XmlOptions.VALIDATE_TREAT_LAX_AS_SKIP); if (_errorListener == null) _errorListener = defaultErrorListener; _constraintEngine = new IdentityConstraint(_errorListener, type.isDocumentType()); _globalTypes = globalLoader; _rootType = type; _rootField = field; _vc = new ValidatorVC(); }
public Validator ( SchemaType type, SchemaField field, SchemaTypeLoader globalLoader, XmlOptions options, Collection defaultErrorListener ) { options = XmlOptions.maskNull(options); _errorListener = (Collection) options.get(XmlOptions.ERROR_LISTENER); _treatLaxAsSkip = options.hasOption(XmlOptions.VALIDATE_TREAT_LAX_AS_SKIP); _strict = options.hasOption(XmlOptions.VALIDATE_STRICT); if (_errorListener == null) _errorListener = defaultErrorListener; _constraintEngine = new IdentityConstraint(_errorListener, type.isDocumentType()); _globalTypes = globalLoader; _rootType = type; _rootField = field; _vc = new ValidatorVC(); }
private XmlObject newInstance(SchemaType type, XmlOptions options) { options = XmlOptions.maskNull(options); Cur c = tempCur(); SchemaType sType = (SchemaType) options.get(XmlOptions.DOCUMENT_TYPE); if (sType == null) sType = type == null ? XmlObject.type : type; if (sType.isDocumentType()) c.createDomDocumentRoot(); else c.createRoot(); c.setType(sType); XmlObject x = (XmlObject) c.getUser(); c.release(); return x; }
private XmlObject newInstance(SchemaType type, XmlOptions options) { options = XmlOptions.maskNull(options); Cur c = tempCur(); SchemaType sType = (SchemaType) options.get(XmlOptions.DOCUMENT_TYPE); if (sType == null) sType = type == null ? XmlObject.type : type; if (sType.isDocumentType()) c.createDomDocumentRoot(); else c.createRoot(); c.setType(sType); XmlObject x = (XmlObject) c.getUser(); c.release(); return x; }
if (sType.isAnonymousType() && ! sType.isDocumentType() && !sType.isAttributeType()) fullFactory = false;
else if (type.getOuterType().isAttributeType() || type.getOuterType().isDocumentType()) if (type.isSimpleType()) flags |= FLAG_SIMPLE_TYPE; if (type.isDocumentType()) flags |= FLAG_DOCUMENT_TYPE; if (type.isAttributeType())