Example #1
0
  /**
   * Convert dom4j attributes to SAX attributes.
   *
   * @param element dom4j Element
   * @return SAX Attributes
   */
  public static Attributes getSAXAttributes(Element element) {
    final AttributesImpl result = new AttributesImpl();
    for (Iterator i = element.attributeIterator(); i.hasNext(); ) {
      final org.dom4j.Attribute attribute = (org.dom4j.Attribute) i.next();

      result.addAttribute(
          attribute.getNamespaceURI(),
          attribute.getName(),
          attribute.getQualifiedName(),
          ContentHandlerHelper.CDATA,
          attribute.getValue());
    }
    return result;
  }
Example #2
0
 /* 538:    */
 /* 539:    */ protected Attributes createAttributes(
     Element element, Attributes namespaceAttributes)
     /* 540:    */ throws SAXException
       /* 541:    */ {
   /* 542:822 */ this.attributes.clear();
   /* 543:824 */ if (namespaceAttributes != null) {
     /* 544:825 */ this.attributes.setAttributes(namespaceAttributes);
     /* 545:    */ }
   /* 546:828 */ for (Iterator iter = element.attributeIterator(); iter.hasNext(); )
   /* 547:    */ {
     /* 548:829 */ Attribute attribute = (Attribute) iter.next();
     /* 549:830 */ this.attributes.addAttribute(
         attribute.getNamespaceURI(),
         attribute.getName(),
         attribute.getQualifiedName(),
         "CDATA",
         attribute.getValue());
     /* 550:    */ }
   /* 551:835 */ return this.attributes;
   /* 552:    */ }