Refine search
protected Map defineNamespaces(Element element, Map namespaces) { Map answer = null; String prefix = element.getPrefix(); if (prefix != null && prefix.length() > 0 && !namespaces.containsKey(prefix)) { answer = new HashMap(namespaces); defineNamespace(answer, prefix, element.getNamespaceURI()); } NamedNodeMap attributes = element.getAttributes(); int length = attributes.getLength(); for (int i = 0; i < length; i++) { Attr attribute = (Attr) attributes.item(i); prefix = attribute.getPrefix(); if (prefix != null && prefix.length() > 0 && !namespaces.containsKey(prefix)) { if (answer == null) { answer = new HashMap(namespaces); } defineNamespace(answer, prefix, attribute.getNamespaceURI()); } } return (answer != null) ? answer : namespaces; }
String elName = el.getLocalName(); if (el.getNamespaceURI().equals(PackageProperties.NAMESPACE_DCTERMS)) if (!(elName.equals(KEYWORD_CREATED) || elName.equals(KEYWORD_MODIFIED))) throw new InvalidFormatException( if (el.getNamespaceURI().equals(PackageProperties.NAMESPACE_DCTERMS)) { if (!typeAtt.getValue().equals(el.getPrefix() + ":W3CDTF")) throw new InvalidFormatException("The element '" + elName + "' must have the 'xsi:type' attribute with the value '" + el.getPrefix() + ":W3CDTF', but had '" + typeAtt.getValue() + "' !");
public static boolean isRdfDescription(Element element) { return (XmpConstants.DEFAULT_RDF_PREFIX.equals(element.getPrefix()) && XmpConstants.DESCRIPTION_NAME .equals(element.getLocalName())); }
String uri = element.getNamespaceURI() == null? "" : element.getNamespaceURI(); String name = element.getLocalName(); handlePrefixMapping(uri, element.getPrefix()); open = this.efactory.makeOpenElement(uri, name);
protected void handleParent(Element e, NameSpaceSymbTable ns) { if (!e.hasAttributes() && e.getNamespaceURI() == null) { return; if (e.getNamespaceURI() != null) { String NName = e.getPrefix(); String NValue = e.getNamespaceURI(); String Name; if (NName == null || NName.equals("")) {
/** * Returns the name of the element. * * @param element the element which name is to be returned * @return the name of the element */ public static String getElementName(Element element) { if (element.getPrefix() != null && element.getPrefix().length() > 0) { return element.getPrefix() + ':' + element.getLocalName(); } else { return element.getLocalName(); } }
String namespaceURI = ((Element) node).getNamespaceURI(); String prefix = ((Element) node).getPrefix(); String localName = ((Element) node).getLocalName();
protected void handleParent(Element e, NameSpaceSymbTable ns) { if (!e.hasAttributes() && e.getNamespaceURI() == null) { return; if (e.getNamespaceURI() != null) { String NName = e.getPrefix(); String NValue = e.getNamespaceURI(); String Name; if (NName == null || NName.equals("")) {
public static boolean isRdfDescription(Element element) { return (XmpConstants.DEFAULT_RDF_PREFIX.equals(element.getPrefix()) && XmpConstants.DESCRIPTION_NAME .equals(element.getLocalName())); }
String namespaceURI = ((Element) node).getNamespaceURI(); String prefix = ((Element) node).getPrefix(); String localName = ((Element) node).getLocalName();
if (element.getPrefix() != null && !parentPrefixes.contains(element.getPrefix())) { thisLevelPrefixes.put(element.getPrefix(), element.getNamespaceURI()); if (attr.getNodeName().startsWith("xmlns")) continue; if (attr.getPrefix() != null && !parentPrefixes.contains(attr.getPrefix())) { thisLevelPrefixes.put(attr.getPrefix(), element.getNamespaceURI());
public static boolean isRdfDescription(Element element) { return (XmpConstants.DEFAULT_RDF_PREFIX.equals(element.getPrefix()) && XmpConstants.DESCRIPTION_NAME .equals(element.getLocalName())); }
public static QName getQName(Element element) { return new QName(element.getNamespaceURI(), element.getLocalName(), element.getPrefix()); }
@Override protected void handleParent(Element e, NameSpaceSymbTable ns) { if (!e.hasAttributes() && e.getNamespaceURI() == null) { return; if (e.getNamespaceURI() != null) { String NName = e.getPrefix(); String NValue = e.getNamespaceURI(); String Name; if (NName == null || NName.equals("")) {
protected String getQName(Element elem) throws SAXException { handlePrefixedAttribute(elem); String prefix = elem.getPrefix(); if (prefix != null && prefix.length() > 0) { String qname = prefix + Constants.COLON + elem.getLocalName(); return qname; } else { return elem.getLocalName(); } }
private void expectNaming(Element element, String ns, String prefix, String ln) throws XmpParsingException { if ((ns != null) && !(ns.equals(element.getNamespaceURI()))) { throw new XmpParsingException(ErrorType.Format, "Expecting namespace '" + ns + "' and found '" + element.getNamespaceURI() + "'"); } else if ((prefix != null) && !(prefix.equals(element.getPrefix()))) { throw new XmpParsingException(ErrorType.Format, "Expecting prefix '" + prefix + "' and found '" + element.getPrefix() + "'"); } else if ((ln != null) && !(ln.equals(element.getLocalName()))) { throw new XmpParsingException(ErrorType.Format, "Expecting local name '" + ln + "' and found '" + element.getLocalName() + "'"); } // else OK }
String uri = elem_node.getNamespaceURI(); if (uri != null) { String prefix = elem_node.getPrefix(); if (prefix==null) prefix="";
protected String getQName(Element elem) throws SAXException { handlePrefixedAttribute(elem); String prefix = elem.getPrefix(); if (prefix != null && prefix.length() > 0) { String qname = prefix + Constants.COLON + elem.getLocalName(); return qname; } else { return elem.getLocalName(); } }
protected void end(Element element, XSDElementDeclaration declaration) throws SAXException { // push off last context namespaces.popContext(); String uri = element.getNamespaceURI(); String local = element.getLocalName(); String qName = element.getLocalName(); if ((element.getPrefix() != null) && !"".equals(element.getPrefix())) { qName = element.getPrefix() + ":" + qName; } else { if (forceQualified(declaration)) { uri = uri != null ? uri : namespaces.getURI(""); if (uri != null) { qName = namespaces.getPrefix(uri) + ":" + qName; } else { uri = ""; } } } serializer.endElement(uri, local, qName); }
if (element.getNamespaceURI() != null && !(element.getPrefix() == null || element.getPrefix().length() == 0)) { prefix = element.getPrefix(); } else { prefix = XMLNS;