public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { super.ignorableWhitespace(ch, start, length); characters(ch, start, length); }
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // set document location eventFactory.setLocation(getCurrentLocation()); // create attribute and namespace events Collection[] events = {null, null}; createStartEvents(attributes, events); // save a reference to the namespace collection so we can use them // again // in the end element namespaceStack.add(events[0]); try { String[] qname = {null, null}; parseQName(qName, qname); consumer.add(eventFactory.createStartElement(qname[0], uri, qname[1], events[1].iterator(), events[0].iterator())); } catch (XMLStreamException e) { throw new SAXException(e); } finally { super.startElement(uri, localName, qName, attributes); } }
public void endElement(String uri, String localName, String qName) throws SAXException { super.endElement(uri, localName, qName); eventFactory.setLocation(getCurrentLocation()); // parse name String[] qname = {null, null}; parseQName(qName, qname); // get namespaces Collection nsList = (Collection) namespaceStack.remove(namespaceStack.size() - 1); Iterator nsIter = nsList.iterator(); try { consumer.add(eventFactory.createEndElement(qname[0], uri, qname[1], nsIter)); } catch (XMLStreamException e) { throw new SAXException(e); } }
String uri = namespaces.getNamespaceURI(prefix); Namespace ns = createNamespace(prefix, uri); if (nsMap == null) { for (int i = 0, s = attributes.getLength(); i < s; i++) { parseQName(attributes.getQName(i), qname); Namespace ns = createNamespace(attrPrefix, attrValue); if (nsMap == null) {
public void comment(char[] ch, int start, int length) throws SAXException { super.comment(ch, start, length); eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createComment(new String(ch, start, length))); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void endDocument() throws SAXException { eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createEndDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } super.endDocument(); // clear the namespaces namespaceStack.clear(); }
public void endCDATA() throws SAXException { eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createCData(CDATABuffer.toString())); } catch (XMLStreamException e) { throw new SAXException(e); } super.endCDATA(); }
public void characters(char[] ch, int start, int length) throws SAXException { super.characters(ch, start, length); try { if (!isCDATA) { eventFactory.setLocation(getCurrentLocation()); consumer.add(eventFactory.createCharacters(new String(ch, start, length))); } } catch (XMLStreamException e) { throw new SAXException(e); } }
public void startDocument() throws SAXException { super.startDocument(); // clear the namespaces in case we ended in error before. namespaceStack.clear(); eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createStartDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } }