/** * Returns the previous sibling * @return the previous sibling */ public final Node getPreviousSibling() { Node prev = null; Node next = parentNode.getFirstChild(); for(;;) { if (this == next) { return prev; } prev = next; next = next.nextSibling; } }
/** * * @see org.xml.sax.ext.LexicalHandler#endCDATA() */ public void endCDATA() throws SAXException { current.setEndLocator(locator); current = current.getParentNode(); }
/** * Detach this node from its parent. */ public void detach() { if (parentNode != null) { parentNode.removeChild(this); parentNode = null; } }
/** * * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) */ public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { current = (ParentNode) current.appendChild(new Element(locator, uri, localName, qName, atts, retainAttributes, prefixMappings)); prefixMappings = null; }
@Override protected void insertFosterParentedChild(Element child, Element table, Element stackParent) throws SAXException { ParentNode parent = table.getParentNode(); if (parent != null) { // always an element if not null parent.insertBetween(child, previousSibling(table), table); cachedTablePreviousSibling = child; } else { stackParent.appendChild(child); } }
/** * * @see org.xml.sax.ContentHandler#endDocument() */ public void endDocument() throws SAXException { current.setEndLocator(locator); }
/** * * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String, java.lang.String, java.lang.String) */ public void startDTD(String name, String publicId, String systemId) throws SAXException { current = (ParentNode) current.appendChild(new DTD(locator, name, publicId, systemId)); }
@Override protected void insertFosterParentedChild(Element child, Element table, Element stackParent) throws SAXException { ParentNode parent = table.getParentNode(); if (parent != null) { // always an element if not null parent.insertBetween(child, previousSibling(table), table); cachedTablePreviousSibling = child; } else { stackParent.appendChild(child); } }
/** * * @see org.xml.sax.ContentHandler#endDocument() */ public void endDocument() throws SAXException { current.setEndLocator(locator); }
/** * * @see org.xml.sax.ext.LexicalHandler#endEntity(java.lang.String) */ public void endEntity(String name) throws SAXException { current.setEndLocator(locator); current = current.getParentNode(); }
/** * * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int) */ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { current.appendChild(new IgnorableWhitespace(locator, ch, start, length)); }
@Override protected void insertFosterParentedChild(Element child, Element table, Element stackParent) throws SAXException { ParentNode parent = table.getParentNode(); if (parent != null) { // always an element if not null parent.insertBetween(child, previousSibling(table), table); cachedTablePreviousSibling = child; } else { stackParent.appendChild(child); } }
/** * Detach this node from its parent. */ public void detach() { if (parentNode != null) { parentNode.removeChild(this); parentNode = null; } }
/** * * @see org.xml.sax.ContentHandler#endDocument() */ public void endDocument() throws SAXException { current.setEndLocator(locator); }
/** * Returns the previous sibling * @return the previous sibling */ public final Node getPreviousSibling() { Node prev = null; Node next = parentNode.getFirstChild(); for(;;) { if (this == next) { return prev; } prev = next; next = next.nextSibling; } }
/** * * @see org.xml.sax.ext.LexicalHandler#endDTD() */ public void endDTD() throws SAXException { current.setEndLocator(locator); current = current.getParentNode(); }
/** * * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String) */ public void processingInstruction(String target, String data) throws SAXException { current.appendChild(new ProcessingInstruction(locator, target, data)); }
@Override protected void insertFosterParentedCharacters(char[] buf, int start, int length, Element table, Element stackParent) throws SAXException { Node child = new Characters(tokenizer, buf, start, length); ParentNode parent = table.getParentNode(); if (parent != null) { // always an element if not null parent.insertBetween(child, previousSibling(table), table); cachedTablePreviousSibling = child; } else { stackParent.appendChild(child); } }
/** * Detach this node from its parent. */ public void detach() { if (parentNode != null) { parentNode.removeChild(this); parentNode = null; } }
/** * Returns the previous sibling * @return the previous sibling */ public final Node getPreviousSibling() { Node prev = null; Node next = parentNode.getFirstChild(); for(;;) { if (this == next) { return prev; } prev = next; next = next.nextSibling; } }