use of org.exist.dom.QName in project exist by eXist-db.
the class SAXToReceiver method endElement.
public void endElement(String uri, String localName, String qName) throws SAXException {
String prefix = null;
final int p = qName.indexOf(':');
if (p > -1) {
prefix = qName.substring(0, p - 1);
}
receiver.endElement(new QName(localName, uri, prefix));
}
use of org.exist.dom.QName in project exist by eXist-db.
the class SAXToReceiver method startElement.
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
String prefix = null;
int p = qName.indexOf(':');
if (p > -1) {
prefix = qName.substring(0, p - 1);
}
final AttrList attrs = new AttrList();
for (int i = 0; i < atts.getLength(); i++) {
if (atts.getQName(i).startsWith("xmlns")) {
continue;
}
String attrPrefix = null;
p = atts.getQName(i).indexOf(':');
if (p > -1) {
attrPrefix = atts.getQName(i).substring(0, p - 1);
}
int type = AttrImpl.CDATA;
final String atype = atts.getType(i);
if ("ID".equals(atype)) {
type = AttrImpl.ID;
} else if ("IDREF".equals(atype)) {
type = AttrImpl.IDREF;
} else if ("IDREFS".equals(atype)) {
type = AttrImpl.IDREFS;
}
attrs.addAttribute(new QName(atts.getLocalName(i), atts.getURI(i), attrPrefix), atts.getValue(i), type);
}
receiver.startElement(new QName(localName, uri, prefix), attrs);
}
use of org.exist.dom.QName in project exist by eXist-db.
the class XMLWriter method startElement.
public void startElement(final String namespaceUri, final String localName, final String qname) throws TransformerException {
if (!declarationWritten) {
writeDeclaration();
}
if (!doctypeWritten) {
writeDoctype(qname);
}
try {
if (tagIsOpen) {
closeStartTag(false);
}
writer.write('<');
writer.write(qname);
tagIsOpen = true;
try {
elementName.push(QName.parse(namespaceUri, qname));
} catch (final QName.IllegalQNameException e) {
throw new TransformerException(e.getMessage(), e);
}
} catch (final IOException ioe) {
throw new TransformerException(ioe.getMessage(), ioe);
}
}
use of org.exist.dom.QName in project exist by eXist-db.
the class XHTMLWriter method endElement.
@Override
public void endElement(final QName qname) throws TransformerException {
final QName xhtmlQName = removeXhtmlPrefix(qname);
super.endElement(xhtmlQName);
haveCollapsedXhtmlPrefix = false;
}
use of org.exist.dom.QName in project exist by eXist-db.
the class NamePool method getSharedName.
public QName getSharedName(final QName name) {
final WrappedQName wrapped = new WrappedQName(name);
final QName sharedName = pool.putIfAbsent(wrapped, name);
if (sharedName == null) {
// The name was not in the pool, return the name just added.
return name;
} else {
// The name was in the pool, return the shared name.
return sharedName;
}
}
Aggregations