Ejemplo n.º 1
0
 @Override
 protected void finishClose() throws IOException {
   try {
     final String uri = string(namespaces.get(elem.prefix()));
     final String lname = string(elem.local());
     final String rname = string(elem.string());
     contentHandler.endElement(uri, lname, rname);
     namespaces = namespaces.getParent();
   } catch (final SAXException ex) {
     throw new IOException(ex);
   }
 }
Ejemplo n.º 2
0
  @Override
  protected void finishOpen() throws IOException {
    try {
      final AttributesImpl attrs = new AttributesImpl();
      final int as = attributes.size();
      for (int a = 0; a < as; a++) {
        final byte[] name = attributes.name(a);
        final String uri = string(namespaces.get(prefix(name)));
        final String lname = string(local(name));
        final String rname = string(name);
        final String value = string(attributes.value(a));
        attrs.addAttribute(uri, lname, rname, null, value);
      }

      final String uri = string(namespaces.get(elem.prefix()));
      final String lname = string(elem.local());
      final String rname = string(elem.string());
      contentHandler.startElement(uri, lname, rname, attrs);

    } catch (final SAXException ex) {
      throw new IOException(ex);
    }
  }