protected void setLocalAttribute(String attrName, String value) { getElement().setAttributeNS(null, attrName, value); }
protected void appendSelf(ElementProxy toAppend) { getElement().appendChild(toAppend.getElement()); }
protected void appendSelf(Node toAppend) { getElement().appendChild(toAppend); }
protected Node getFirstChild() { return getElement().getFirstChild(); }
protected String getLocalAttribute(String attrName) { return getElement().getAttributeNS(null, attrName); }
/** * Method getTextFromTextChild * * @return the Text obtained by concatenating all the text nodes of this * element */ public String getTextFromTextChild() { return XMLUtils.getFullTextChildrenFromElement(getElement()); }
protected void setLocalIdAttribute(String attrName, String value) { if (value != null) { Attr attr = getDocument().createAttributeNS(null, attrName); attr.setValue(value); getElement().setAttributeNodeNS(attr); getElement().setIdAttributeNode(attr, true); } else { getElement().removeAttributeNS(null, attrName); } }
protected void addReturnToSelf() { XMLUtils.addReturnToElement(getElement()); }
/** * Method guaranteeThatElementInCorrectSpace * * @throws XMLSecurityException */ void guaranteeThatElementInCorrectSpace() throws XMLSecurityException { String expectedLocalName = this.getBaseLocalName(); String expectedNamespaceUri = this.getBaseNamespace(); String actualLocalName = getElement().getLocalName(); String actualNamespaceUri = getElement().getNamespaceURI(); if(!expectedNamespaceUri.equals(actualNamespaceUri) && !expectedLocalName.equals(actualLocalName)) { Object exArgs[] = { actualNamespaceUri + ":" + actualLocalName, expectedNamespaceUri + ":" + expectedLocalName}; throw new XMLSecurityException("xml.WrongElement", exArgs); } }
Attr a = getElement().getAttributeNodeNS(Constants.NamespaceSpecNS, ns); Object exArgs[] = { ns, getElement().getAttributeNS(null, ns) }; getElement().setAttributeNS(Constants.NamespaceSpecNS, ns, uri);
/** * Returns the Element plus a leading and a trailing CarriageReturn Text node. * * @return the Element which was constructed by the Object. */ public final NodeList getElementPlusReturns() { HelperNodeList nl = new HelperNodeList(); nl.appendChild(createText("\n")); nl.appendChild(getElement()); nl.appendChild(createText("\n")); return nl; }