private boolean matchElementWithBaseElement() { if (eb.getName() == ed.getName() && eb.getNamespace() == ed.getNamespace()) { // The elements match without using sub-groups. Remember this fact // so that we know we don't need to check sub-groups. matchedHead = eb == ed; return true; } // if the name doesn't match, try its sub group elements XSElementDecl[] ebs = sgh.getSubstitutionGroup(eb, Constants.SCHEMA_VERSION_1_1); for (int i = 0; i < ebs.length; i++) { if (ebs[i].getName() == ed.getName() && ebs[i].getNamespace() == ed.getNamespace()) { eb = ebs[i]; return true; } } return false; }
/** * * @param element * @throws OdaException */ public ATreeNode( XSElementDecl element ) throws OdaException { this(); this.element = element; this.value = element.getName( ); this.type = ELEMENT_TYPE; if ( element.getTypeDefinition( ).getName( ) != null ) this.dataType = getDataType( element.getTypeDefinition( ).getName( ) ); else this.dataType = getDataType( element.getName( ) ); }
public int compare(Object o1, Object o2) { XSParticleDecl pDecl1 = (XSParticleDecl) o1; XSParticleDecl pDecl2 = (XSParticleDecl) o2; XSElementDecl decl1 = (XSElementDecl) pDecl1.fValue; XSElementDecl decl2 = (XSElementDecl) pDecl2.fValue; String namespace1 = decl1.getNamespace(); String namespace2 = decl2.getNamespace(); String name1 = decl1.getName(); String name2 = decl2.getName(); boolean sameNamespace = (namespace1 == namespace2); int namespaceComparison = 0; if (!sameNamespace) { if (namespace1 != null) { if (namespace2 != null){ namespaceComparison = namespace1.compareTo(namespace2); } else { namespaceComparison = 1; } } else { namespaceComparison = -1; } } //This assumes that the names are never null. return namespaceComparison != 0 ? namespaceComparison : name1.compareTo(name2); } };
(UniqueValueStore) fIdentityConstraint2ValueStoreMap.get(toHash); if (uniqueValueStore == null) { uniqueValueStore = new UniqueValueStore(unique, eDecl.getName()); fIdentityConstraint2ValueStoreMap.put(toHash, uniqueValueStore); } else { uniqueValueStore.clear(); uniqueValueStore.setElementName(eDecl.getName()); (KeyValueStore) fIdentityConstraint2ValueStoreMap.get(toHash); if (keyValueStore == null) { keyValueStore = new KeyValueStore(key, eDecl.getName()); fIdentityConstraint2ValueStoreMap.put(toHash, keyValueStore); } else { keyValueStore.clear(); keyValueStore.setElementName(eDecl.getName()); (KeyRefValueStore) fIdentityConstraint2ValueStoreMap.get(toHash); if (keyRefValueStore == null) { keyRefValueStore = new KeyRefValueStore(keyRef, null, eDecl.getName()); fIdentityConstraint2ValueStoreMap.put(toHash, keyRefValueStore); } else { keyRefValueStore.clear(); keyRefValueStore.setElementName(eDecl.getName());
void addGlobalElementDecl(XSElementDecl decl) { final String namespace = decl.getNamespace(); final String declKey = (namespace == null || namespace.length() == 0) ? "," + decl.getName() : namespace + "," + decl.getName(); if (fGlobalElemDecls.get(declKey) == null) { fGlobalElemDecls.put(declKey, decl); } }
reportSchemaError("cos-all-limited.2", new Object[]{ (max == SchemaSymbols.OCCURRENCE_UNBOUNDED) ? SchemaSymbols.ATTVAL_UNBOUNDED : Integer.toString(max), ((XSElementDecl)particle.fValue).getName()}, parent); max = 1; if (min > 1)
while ((eb = base.nextElementTransition(b, bn, indexb)) != null) { int ib = indexb[0]; if (eb.getName() == ed.getName() && eb.getNamespace() == ed.getNamespace()) { for (int i = 0; i < ebs.length; i++) { if (ebs[i].getName() == ed.getName() && ebs[i].getNamespace() == ed.getNamespace()) { if (matchD[id] != -1 && matchD[id] != ib) {
dstDecl = dstGrammar.getGlobalElementDecl(srcDecl.getName()); if (dstDecl == null) { dstGrammar.addGlobalElementDecl(srcDecl);
XSAnnotation ann = el.getAnnotation(); String documentation = parseAnnotationString( "Element " + el.getNamespace() + ":" + el.getName() + " documentation", ann != null ? ann.getAnnotationString() : null ); final FieldDesc fd1 = new FieldDesc( FieldDesc.STR, Util.toJavaFieldName(el.getName()), et.getName(), null, ); fd1.documentation = documentation; fd1.tagName = el.getName(); while (et.getBaseType() != null && !"anySimpleType".equals(et.getBaseType() .getName()) && !"anyType".equals(et.getBaseType() XSParticle p = clist.get(i); XSElementDecl el = (XSElementDecl) p.getTerm(); String s = Util.toJavaFieldName(el.getName()); if (p.getMaxOccursUnbounded() || p.getMaxOccurs() > 1) { s = Util.pluralize(s);
/** * get schema tree node from <code>xsdFileName</code> according to encoding <code>xmlEncoding</code>. * @param xsdFileName * @param xmlEncoding * @return * @throws OdaException * @throws MalformedURLException * @throws URISyntaxException */ public static ATreeNode getSchemaTree( String xsdFileName, String xmlEncoding ) throws OdaException, MalformedURLException, URISyntaxException { XSNamedMap map = loadSchema( xsdFileName, xmlEncoding ); ATreeNode root = new ATreeNode( ); root.setValue( "ROOT" ); for ( int i = 0; i < map.getLength( ); i++ ) { XSElementDecl element = (XSElementDecl) map.item( i ); ATreeNode node = new ATreeNode( element ); node.setValue( element.getName( ) ); node.setType( ATreeNode.ELEMENT_TYPE ); node.setDataType( element.getName( ) ); root.addChild( node ); } return root; } /**
reportSchemaError( "e-props-correct.7", new Object[] {element.getName(), XS11TypeHelper.getSchemaTypeName(alternativeType), XS11TypeHelper.getSchemaTypeName(element.fType)}, altElement);
for (int i = 0; i < length; ++i) { XSElementDecl decl = (XSElementDecl) map.item(i); if (cachedGrammar.getGlobalElementDecl(decl.getName()) == null) { cachedGrammar.addGlobalElementDecl(decl);