/** * Determine whether this node has the is-idref property * * @return true if the node is an IDREF or IDREFS element or attribute */ public boolean isIdref() { return getNodeKind() == Type.ATTRIBUTE && ( ((Attribute) node).getType() == Attribute.Type.IDREF || ((Attribute) node).getType() == Attribute.Type.IDREFS); }
/** * Determine whether this node has the is-idref property * * @return true if the node is an IDREF or IDREFS element or attribute */ public boolean isIdref() { return getNodeKind() == Type.ATTRIBUTE && ( ((Attribute) node).getType() == Attribute.Type.IDREF || ((Attribute) node).getType() == Attribute.Type.IDREFS); }
/** * Determine whether this node has the is-idref property * * @return true if the node is an IDREF or IDREFS element or attribute */ public boolean isIdref() { return getNodeKind() == Type.ATTRIBUTE && ( ((Attribute) node).getType() == Attribute.Type.IDREF || ((Attribute) node).getType() == Attribute.Type.IDREFS); }
/** * Determine whether this node has the is-id property * * @return true if the node is an ID */ public boolean isId() { return getNodeKind() == Type.ATTRIBUTE && ((Attribute) node).getType() == Attribute.Type.ID; }
/** * Determine whether this node has the is-id property * * @return true if the node is an ID */ public boolean isId() { return getNodeKind() == Type.ATTRIBUTE && ((Attribute) node).getType() == Attribute.Type.ID; }
/** * Determine whether this node has the is-id property * * @return true if the node is an ID */ public boolean isId() { return getNodeKind() == Type.ATTRIBUTE && ((Attribute) node).getType() == Attribute.Type.ID; }
/** Reuses XOM's way of representing attribute types */ public static byte getAttributeTypeCode(Attribute attr) { return (byte) attr.getType().hashCode(); }
/** Reuses XOM's way of representing attribute types */ public static byte getAttributeTypeCode(Attribute attr) { return (byte) attr.getType().hashCode(); }
private void buildIDIndex(Element elem) { // walk the tree in reverse document order, to satisfy the XPath 1.0 rule // that says if an ID appears twice, the first one wins for (int i = elem.getChildCount(); --i >= 0; ) { Node child = elem.getChild(i); if (child instanceof Element) { buildIDIndex((Element) child); } } for (int i = elem.getAttributeCount(); --i >= 0; ) { Attribute att = elem.getAttribute(i); if (att.getType() == Attribute.Type.ID) { idIndex.put(att.getValue(), wrap(elem)); } } }
private void buildIDIndex(Element elem) { // walk the tree in reverse document order, to satisfy the XPath 1.0 rule // that says if an ID appears twice, the first one wins for (int i = elem.getChildCount(); --i >= 0; ) { Node child = elem.getChild(i); if (child instanceof Element) { buildIDIndex((Element) child); } } for (int i = elem.getAttributeCount(); --i >= 0; ) { Attribute att = elem.getAttribute(i); if (att.getType() == Attribute.Type.ID) { idIndex.put(att.getValue(), wrap(elem)); } } }
private void buildIDIndex(Element elem) { // walk the tree in reverse document order, to satisfy the XPath 1.0 rule // that says if an ID appears twice, the first one wins for (int i=elem.getChildCount(); --i >= 0 ; ) { Node child = elem.getChild(i); if (child instanceof Element) { buildIDIndex((Element)child); } } for (int i=elem.getAttributeCount(); --i >= 0 ; ) { Attribute att = elem.getAttribute(i); if (att.getType() == Attribute.Type.ID) { idIndex.put(att.getValue(), wrap(elem)); } } }
if (attr.getType() != type) attr.setType(type); attr.setValue(value); return attr;
if (attr.getType() != type) attr.setType(type); attr.setValue(value); return attr;