List of usage examples for javax.xml.stream XMLStreamReader getPrefix
public String getPrefix();
From source file:org.unitedinternet.cosmo.util.DomReader.java
private static Element readElement(Document d, XMLStreamReader reader) throws XMLStreamException { Element e = null;/*from w w w. jav a 2s .c o m*/ String local = reader.getLocalName(); String ns = reader.getNamespaceURI(); if (ns != null && !ns.equals("")) { String prefix = reader.getPrefix(); String qualified = prefix != null && !prefix.isEmpty() ? prefix + ":" + local : local; e = d.createElementNS(ns, qualified); } else { e = d.createElement(local); } //if (log.isDebugEnabled()) //log.debug("Reading element " + e.getTagName()); for (int i = 0; i < reader.getAttributeCount(); i++) { Attr a = readAttribute(i, d, reader); if (a.getNamespaceURI() != null) { e.setAttributeNodeNS(a); } else { e.setAttributeNode(a); } } return e; }