public void visitName(Name name) { startElement("name"); attribute("ns", name.getNamespaceUri()); data(name.getLocalName()); endElement(); }
public void visitName(Name name) { startElement("name"); attribute("ns", name.getNamespaceUri()); data(name.getLocalName()); endElement(); }
private String getDefineName(Name elementName) { if (prefixSeparator != null) { String prefix = schema.getPrefixMap().get(elementName.getNamespaceUri()); if (prefix != null) return prefix + prefixSeparator + elementName.getLocalName(); } return elementName.getLocalName(); }
static private String createWrapper(Name attributeOwner) { return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"" + " targetNamespace=\"" + attributeOwner.getNamespaceUri() + "\">" + " <xs:element name=\"" + attributeOwner.getLocalName() + "\">" + " <xs:complexType><xs:anyAttribute processContents=\"strict\"/></xs:complexType>" + " </xs:element>" + "</xs:schema>"; }
static private String createWrapper(Name attributeOwner) { return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"" + " targetNamespace=\"" + attributeOwner.getNamespaceUri() + "\">" + " <xs:element name=\"" + attributeOwner.getLocalName() + "\">" + " <xs:complexType><xs:anyAttribute processContents=\"strict\"/></xs:complexType>" + " </xs:element>" + "</xs:schema>"; }
public Object visitElement(ElementParticle p) { Name name = p.getName(); String ns = name.getNamespaceUri(); if (ns.equals(defaultNamespace)) return name.getLocalName(); return "{" + name.getNamespaceUri() + "}" + name.getLocalName(); }
public boolean contains(Name name) { Set<String> excludedLocalNames = nsMap.get(name.getNamespaceUri()); if (excludedLocalNames == null) return super.contains(name); else return !excludedLocalNames.contains(name.getLocalName()); }
private void validateAttributes(Schema schema, Attributes attributes) throws SAXException { Validator validator = createValidator(schema); ContentHandler ch = validator.getContentHandler(); initHandler(ch); ch.startElement(OWNER_NAME.getNamespaceUri(), OWNER_NAME.getLocalName(), OWNER_NAME.getLocalName(), attributes); ch.endElement(OWNER_NAME.getNamespaceUri(), OWNER_NAME.getLocalName(), OWNER_NAME.getLocalName()); cleanupHandler(ch); releaseValidator(schema, validator); }
private void startData(DataPattern p) { startElement("data"); final Name dtName = p.getDatatypeName(); attribute("type", dtName.getLocalName()); attribute("datatypeLibrary", dtName.getNamespaceUri()); for (Iterator<String> iter = p.getParams().iterator(); iter.hasNext();) { startElement("param"); attribute("name", iter.next()); data(iter.next()); endElement(); } }
private void startData(DataPattern p) { startElement("data"); final Name dtName = p.getDatatypeName(); attribute("type", dtName.getLocalName()); attribute("datatypeLibrary", dtName.getNamespaceUri()); for (Iterator<String> iter = p.getParams().iterator(); iter.hasNext();) { startElement("param"); attribute("name", iter.next()); data(iter.next()); endElement(); } }
public boolean contains(Name name) { Set<String> excludedLocalNames = nsMap.get(name.getNamespaceUri()); if (excludedLocalNames == null) return super.contains(name); else return !excludedLocalNames.contains(name.getLocalName()); }
private void validateAttributes(Schema schema, Attributes attributes) throws SAXException { Validator validator = createValidator(schema); ContentHandler ch = validator.getContentHandler(); initHandler(ch); ch.startElement(OWNER_NAME.getNamespaceUri(), OWNER_NAME.getLocalName(), OWNER_NAME.getLocalName(), attributes); ch.endElement(OWNER_NAME.getNamespaceUri(), OWNER_NAME.getLocalName(), OWNER_NAME.getLocalName()); cleanupHandler(ch); releaseValidator(schema, validator); }
private static DataPattern makeDatatype(Name datatypeName) { return new DataPattern(datatypeName.getNamespaceUri(), datatypeName.getLocalName()); }
static String format(Name name) { String localName = name.getLocalName(); String namespaceUri = name.getNamespaceUri(); if (namespaceUri.equals("")) return SchemaBuilderImpl.localizer.message("name_absent_namespace", localName); else return SchemaBuilderImpl.localizer.message("name_with_namespace", namespaceUri, localName); } }
static String format(Name name) { String localName = name.getLocalName(); String namespaceUri = name.getNamespaceUri(); if (namespaceUri.equals("")) return SchemaBuilderImpl.localizer.message("name_absent_namespace", localName); else return SchemaBuilderImpl.localizer.message("name_with_namespace", namespaceUri, localName); } }
private NameNameClass makeNameClass(Name name) { String ns = name.getNamespaceUri(); NameNameClass nnc = new NameNameClass(ns, name.getLocalName()); if (!ns.equals("")) { String prefix = schema.getPrefixMap().get(ns); if (prefix != null) nnc.setPrefix(prefix); } return nnc; }
protected void outputName(NameClass nc) { if (nc instanceof SimpleNameClass) { Name name = ((SimpleNameClass)nc).getName(); attribute("name", name.getLocalName()); attribute("ns", name.getNamespaceUri()); } else nc.accept(nameClassDumper); }
protected void outputName(NameClass nc) { if (nc instanceof SimpleNameClass) { Name name = ((SimpleNameClass)nc).getName(); attribute("name", name.getLocalName()); attribute("ns", name.getNamespaceUri()); } else nc.accept(nameClassDumper); }
public VoidValue visitElement(Element p) { Name name = p.getName(); if (nsm.isGlobal(p) && name.getNamespaceUri().equals(targetNamespace) && !globalElementsDefined.contains(name)) { globalElementsDefined.add(name); xw.startElement(xs("element")); xw.attribute("name", name.getLocalName()); outputComplexType(name, p.getComplexType(), p); xw.endElement(); } return p.getComplexType().accept(this); }
private boolean tryAbstractElement(GroupDefinition def) { Name name = nsm.getGroupDefinitionAbstractElementName(def); if (name == null) return false; xw.startElement(xs("element")); xw.attribute("name", name.getLocalName()); xw.attribute("abstract", "true"); outputComplexType(name, abstractElementTypeSelector.getAbstractElementType(name), def); xw.endElement(); return true; }