/** * Convenience method. Returns a top-level element declaration. * @param name The name of the declaration. * @return A top-level element declaration or null if such declaration * does not exist. */ public XSElementDeclaration getElementDeclaration(String name) { return getGlobalElementDecl(name); }
public XSElementDecl getGlobalElementDecl(QName name) { SchemaGrammar sg = gb.getGrammar(name.uri); return sg != null ? sg.getGlobalElementDecl(name.localpart) : null; }
public XSElementDecl getGlobalElementDecl(QName element) { SchemaGrammar sGrammar = fGrammarBucket.getGrammar(element.uri); if (sGrammar != null) { return sGrammar.getGlobalElementDecl(element.localpart); } return null; }
public XSElementDecl getGlobalElementDecl(QName element) { final SchemaGrammar sGrammar = findSchemaGrammar( XSDDescription.CONTEXT_ELEMENT, element.uri, null, element, null); if (sGrammar != null) { return sGrammar.getGlobalElementDecl(element.localpart); } return null; }
void processRootElementDeclQName(final javax.xml.namespace.QName rootElementDeclQName, final QName element) { String rootElementDeclNamespace = rootElementDeclQName.getNamespaceURI(); // Add namespace to symbol table, to make sure it's interned. // This namespace may be later compared with other values using ==. rootElementDeclNamespace = fSymbolTable.addSymbol(rootElementDeclNamespace); if (rootElementDeclNamespace != null && rootElementDeclNamespace.equals(XMLConstants.NULL_NS_URI)) { rootElementDeclNamespace = null; } final SchemaGrammar grammarForRootElement = findSchemaGrammar( XSDDescription.CONTEXT_ELEMENT, rootElementDeclNamespace, null, null, null); if (grammarForRootElement != null) { fCurrentElemDecl = grammarForRootElement.getGlobalElementDecl(rootElementDeclQName.getLocalPart()); } if (fCurrentElemDecl == null) { String declName = (rootElementDeclQName.getPrefix().equals(XMLConstants.DEFAULT_NS_PREFIX)) ? rootElementDeclQName.getLocalPart() : rootElementDeclQName.getPrefix()+":"+rootElementDeclQName.getLocalPart(); reportSchemaError("cvc-elt.1.a", new Object[] {declName}); } else { checkElementMatchesRootElementDecl(fCurrentElemDecl, element); } } // processRootElementDeclQName
/** * Convenience method. Returns a top-level element declaration. * @param name The name of the declaration. * @param namespace The namespace of the definition, otherwise null. * @param loc The schema location where the component was defined * @return A top-level element declaration or null if such declaration * does not exist. */ public XSElementDeclaration getElementDeclaration(String name, String namespace, String loc) { SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); if (sg == null) { return null; } return sg.getGlobalElementDecl(name, loc); }
dstDecl = dstGrammar.getGlobalElementDecl(srcDecl.getName()); if (dstDecl == null) { dstGrammar.addGlobalElementDecl(srcDecl); dstDecl = dstGrammar.getGlobalElementDecl(name, location); if ( dstDecl == null) { dstGrammar.addGlobalElementDecl(srcDecl, location);
final SchemaGrammar grammar = grammarBucket.getGrammar(elem.fTargetNamespace); if (grammar != null) { final XSElementDecl gElem = grammar.getGlobalElementDecl(elem.fName); if (gElem != null) { if (gElem != elem && XS11TypeHelper.isTypeTablesComparable(elem.getTypeAlternatives(), gElem.getTypeAlternatives()) && !isTypeTablesEquivalent(elem, gElem)) {
protected Object getGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, String localpart) { Object retObj = null; switch (declType) { case ATTRIBUTE_TYPE : retObj = sGrammar.getGlobalAttributeDecl(localpart); break; case ATTRIBUTEGROUP_TYPE : retObj = sGrammar.getGlobalAttributeGroupDecl(localpart); break; case ELEMENT_TYPE : retObj = sGrammar.getGlobalElementDecl(localpart); break; case GROUP_TYPE : retObj = sGrammar.getGlobalGroupDecl(localpart); break; case IDENTITYCONSTRAINT_TYPE : retObj = sGrammar.getIDConstraintDecl(localpart); break; case NOTATION_TYPE : retObj = sGrammar.getGlobalNotationDecl(localpart); break; case TYPEDECL_TYPE : retObj = sGrammar.getGlobalTypeDecl(localpart); break; } return retObj; }
protected Object getGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, String localpart, String schemaLoc) { Object retObj = null; switch (declType) { case ATTRIBUTE_TYPE : retObj = sGrammar.getGlobalAttributeDecl(localpart, schemaLoc); break; case ATTRIBUTEGROUP_TYPE : retObj = sGrammar.getGlobalAttributeGroupDecl(localpart, schemaLoc); break; case ELEMENT_TYPE : retObj = sGrammar.getGlobalElementDecl(localpart, schemaLoc); break; case GROUP_TYPE : retObj = sGrammar.getGlobalGroupDecl(localpart, schemaLoc); break; case IDENTITYCONSTRAINT_TYPE : retObj = sGrammar.getIDConstraintDecl(localpart, schemaLoc); break; case NOTATION_TYPE : retObj = sGrammar.getGlobalNotationDecl(localpart, schemaLoc); break; case TYPEDECL_TYPE : retObj = sGrammar.getGlobalTypeDecl(localpart, schemaLoc); break; } return retObj; }
if (sg.getGlobalElementDecl(name) == component) { return true;
grammar.addGlobalElementDeclAll(element); if (grammar.getGlobalElementDecl(element.fName) == null) { grammar.addGlobalElementDecl(element); final XSElementDecl element2 = grammar.getGlobalElementDecl(element.fName, loc); if (element2 == null) { grammar.addGlobalElementDecl(element, loc);
sg.addGlobalElementDeclAll((XSElementDecl) component); if (sg.getGlobalElementDecl(name) == null) { sg.addGlobalElementDecl((XSElementDecl) component); if (sg.getGlobalElementDecl(name, "") == null) { sg.addGlobalElementDecl((XSElementDecl) component, "");
attributes); if (sGrammar != null) { fCurrentElemDecl = sGrammar.getGlobalElementDecl(element.localpart);
for (int i = 0; i < length; ++i) { XSElementDecl decl = (XSElementDecl) map.item(i); if (cachedGrammar.getGlobalElementDecl(decl.getName()) == null) { cachedGrammar.addGlobalElementDecl(decl);