private boolean getAttributeQualification(XmlSchemaAttribute attr, String uri) { QName schemaName = attr.getQName(); boolean qualified = false; if (attr.getForm() == XmlSchemaForm.QUALIFIED) { qualified = true; } else { qualified = WSDLUtils.isElementFormQualified(xmlSchemaList, schemaName); } return qualified; }
/** * Obtain a suitable name for use in Javascript for an attribute. This function * is purely a tribute to the awful modularity of XmlSchema. * @param attribute * @param qualified * @return */ public String xmlAttributeString(XmlSchemaAttribute attribute, boolean qualified) { if (qualified) { // What if there were a prefix in the element's qname? This is not apparently // something that happens in this environment. String prefix = getPrefix(attribute.getQName().getNamespaceURI()); collect(prefix, attribute.getQName().getNamespaceURI()); return prefix + ":" + attribute.getName(); } return attribute.getName(); // use the non-qualified name. }
XmlSchema localSchema, XmlSchema attributeSchema) { if (attribute.getQName() == null) { throw new RuntimeException("getSchemaQualifier on anonymous element."); return isAttributeNameQualified(attribute, attributeSchema) || (localSchema != null && !(attribute.getQName().getNamespaceURI().equals(localSchema.getTargetNamespace()))); } else { return isAttributeNameQualified(attribute, attributeSchema);
XmlSchema localSchema, XmlSchema attributeSchema) { if (attribute.getQName() == null) { throw new RuntimeException("getSchemaQualifier on anonymous element."); return isAttributeNameQualified(attribute, attributeSchema) || (localSchema != null && !(attribute.getQName().getNamespaceURI().equals(localSchema.getTargetNamespace())));
XmlSchema localSchema, XmlSchema attributeSchema) { if (attribute.getQName() == null) { throw new RuntimeException("getSchemaQualifier on anonymous element."); return isAttributeNameQualified(attribute, attributeSchema) || (localSchema != null && !(attribute.getQName().getNamespaceURI().equals(localSchema.getTargetNamespace()))); } else { return isAttributeNameQualified(attribute, attributeSchema);
XmlSchema localSchema, XmlSchema attributeSchema) { if (attribute.getQName() == null) { throw new RuntimeException("getSchemaQualifier on anonymous element."); return isAttributeNameQualified(attribute, attributeSchema) || (localSchema != null && !(attribute.getQName().getNamespaceURI().equals(localSchema.getTargetNamespace())));
XmlSchema localSchema, XmlSchema attributeSchema) { if (attribute.getQName() == null) { throw new RuntimeException("getSchemaQualifier on anonymous element."); return isAttributeNameQualified(attribute, attributeSchema) || (localSchema != null && !(attribute.getQName().getNamespaceURI().equals(localSchema.getTargetNamespace()))); } else { return isAttributeNameQualified(attribute, attributeSchema);
String attributeNamespaceURI = attribute.getQName().getNamespaceURI(); boolean attributeNoNamespace = "".equals(attributeNamespaceURI); attributeInfo.javascriptName = attribute.getQName().getLocalPart(); attributeInfo.defaultValue = attribute.getDefaultValue(); attributeInfo.fixedValue = attribute.getFixedValue();
private static void factorySetupType(XmlSchemaAttribute element, SchemaCollection schemaCollection, AttributeInfo attributeInfo) { attributeInfo.type = element.getSchemaType(); if (attributeInfo.type == null) { if (element.getSchemaTypeName().equals(Constants.XSD_ANYTYPE)) { attributeInfo.anyType = true; } else { attributeInfo.type = schemaCollection.getTypeByQName(element.getSchemaTypeName()); if (attributeInfo.type == null && !element.getSchemaTypeName() .getNamespaceURI().equals(Constants.URI_2001_SCHEMA_XSD)) { JavascriptUtils.unsupportedConstruct("MISSING_TYPE", element.getSchemaTypeName() .toString(), element.getQName(), element); } } } else if (attributeInfo.type.getQName() != null && Constants.XSD_ANYTYPE.equals(attributeInfo.type.getQName())) { attributeInfo.anyType = true; } }
if (item instanceof XmlSchemaAttribute) { final XmlSchemaAttribute attribute = (XmlSchemaAttribute) item; final Object old = typeInfo.attributes.put(attribute.getQName().getLocalPart(), attribute.getSchemaTypeName()); if (old != null) { throw new IllegalArgumentException("Complain to your expert group member, spec does not support attributes with the same local name and differing namespaces: original: " + old + ", duplicate local name: " + attribute);
QName attrName = attribute.getQName(); if (attrName.getNamespaceURI().isEmpty()) { attrName = new QName(uri, attrName.getLocalPart());