Node(Node parent, String tag, Attributes attrs) { _parent = parent; _tag = tag; if (attrs != null) { _attrs = new Attribute[attrs.getLength()]; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getLocalName(i); if (name == null || name.equals("")) name = attrs.getQName(i); _attrs[i] = new Attribute(name, attrs.getValue(i)); } } }
Node(Node parent, String tag, Attributes attrs) { _parent = parent; _tag = tag; if (attrs != null) { _attrs = new Attribute[attrs.getLength()]; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getLocalName(i); if (name == null || name.equals("")) name = attrs.getQName(i); _attrs[i] = new Attribute(name, attrs.getValue(i)); } } }
Node(Node parent, String tag, Attributes attrs) { _parent = parent; _tag = tag; if (attrs != null) { _attrs = new Attribute[attrs.getLength()]; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getLocalName(i); if (name == null || name.equals("")) name = attrs.getQName(i); _attrs[i] = new Attribute(name, attrs.getValue(i)); } } }
Node(Node parent, String tag, Attributes attrs) { _parent = parent; _tag = tag; if (attrs != null) { _attrs = new Attribute[attrs.getLength()]; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getLocalName(i); if (name == null || name.equals("")) name = attrs.getQName(i); _attrs[i] = new Attribute(name, attrs.getValue(i)); } } }
/** * Get an element attribute. * * @param name the name of the element * @param dft the default value * @return attribute or null. */ public String getAttribute(String name, String dft) { if (_attrs == null || name == null) return dft; for (int i = 0; i < _attrs.length; i++) if (name.equals(_attrs[i].getName())) return _attrs[i].getValue(); return dft; }
Node(Node parent, String tag, Attributes attrs) { _parent = parent; _tag = tag; if (attrs != null) { _attrs = new Attribute[attrs.getLength()]; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getLocalName(i); if (name == null || name.equals("")) name = attrs.getQName(i); _attrs[i] = new Attribute(name, attrs.getValue(i)); } } }
Node(Node parent, String tag, Attributes attrs) { _parent = parent; _tag = tag; if (attrs != null) { _attrs = new Attribute[attrs.getLength()]; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getLocalName(i); if (name == null || name.equals("")) name = attrs.getQName(i); _attrs[i] = new Attribute(name, attrs.getValue(i)); } } }