Ejemplo n.º 1
0
 /** regenerate the stream from buffer */
 public void dump(XPathHandler next) {
   int last = byteBuffer.position();
   byteBuffer.position(0);
   while (byteBuffer.position() < last)
     try {
       switch (getByte()) {
         case 0:
           String uri = getString();
           String name = getString();
           String tag = getString();
           AttributesImpl atts = new AttributesImpl();
           int len = getShort();
           for (int i = 0; i < len; i++) atts.addAttribute("", "", getString(), "", getString());
           next.startElement(uri, name, tag, atts);
           break;
         case 1:
           next.endElement(getString(), getString(), getString());
           break;
         case 2:
           char[] text = getChars();
           next.characters(text, 0, text.length);
       }
     } catch (SAXException e) {
       throw new Error(e);
     }
   ;
   byteBuffer.clear();
 }
Ejemplo n.º 2
0
 public void characters(char[] text, int start, int length) throws SAXException {
   next.characters(text, start, length);
   condition.characters(text, start, length);
 }