/** Fills in the XMLAttributes object. */ private void fillXMLAttributes2(Attributes2 att) { fAttributes.removeAllAttributes(); final int len = att.getLength(); for (int i = 0; i < len; ++i) { fillXMLAttribute(att, i); fAttributes.setSpecified(i, att.isSpecified(i)); if (att.isDeclared(i)) { fAttributes.getAugmentations(i).putItem(Constants.ATTRIBUTE_DECLARED, Boolean.TRUE); } } }
public void startElement ( String uri, String localName, String qName, Attributes atts ) throws SAXException { Node top; super.startElement (uri, localName, qName, atts); // might there be more work? top = getTop (); if (!top.hasAttributes () || !(atts instanceof Attributes2)) return; // remember any attributes that got defaulted DomNamedNodeMap map = (DomNamedNodeMap) top.getAttributes (); Attributes2 attrs = (Attributes2) atts; int length = atts.getLength (); //map.compact (); for (int i = 0; i < length; i++) { if (attrs.isSpecified (i)) continue; // value was defaulted. String temp = attrs.getQName (i); DomAttr attr; if ("".equals (temp)) attr = (DomAttr) map.getNamedItemNS (attrs.getURI (i), atts.getLocalName (i)); else attr = (DomAttr) map.getNamedItem (temp); // DOM L2 can't write this flag, only read it attr.setSpecified (false); } }
private Attributes replace(Attributes attrs){ if(attrs instanceof Attributes2){ attribute2Replacer.setDelegate((Attributes2)attrs); return attribute2Replacer; }else{ attributeReplacer.setDelegate(attrs); return attributeReplacer; } }
public void setDelegate(Attributes2 delegate){ super.setDelegate(delegate); this.delegate = delegate; }