Index: Element.java =================================================================== RCS file: /home/cvspublic/jdom/src/java/org/jdom/Element.java,v retrieving revision 1.99 diff -u -r1.99 Element.java --- Element.java 2001/08/29 21:45:28 1.99 +++ Element.java 2001/09/29 22:00:30 @@ -667,85 +667,6 @@ /** *

- * This convenience method returns the textual content of the named - * child element, or returns an empty String ("") - * if the child has no textual content. However, if the child does - * not exist, null is returned. - *

- * - * @param name the name of the child - * @return text content for the named child, or null if none - */ - public String getChildText(String name) { - Element child = getChild(name); - if (child == null) { - return null; - } else { - return child.getText(); - } - } - - /** - *

- * This convenience method returns the trimmed textual content of the - * named child element, or returns null if there's no such child. - * See {@link #getTextTrim()} for details of text trimming. - *

- * - * @param name the name of the child - * @return trimmed text content for the named child, or null if none - */ - public String getChildTextTrim(String name) { - Element child = getChild(name); - if (child == null) { - return null; - } else { - return child.getTextTrim(); - } - } - - /** - *

- * This convenience method returns the textual content of the named - * child element, or returns null if there's no such child. - *

- * - * @param name the name of the child - * @param ns the namespace of the child - * @return text content for the named child, or null if none - */ - public String getChildText(String name, Namespace ns) { - Element child = getChild(name, ns); - if (child == null) { - return null; - } else { - return child.getText(); - } - } - - /** - *

- * This convenience method returns the trimmed textual content of the - * named child element, or returns null if there's no such child. - * See {@link #getTextTrim()} for - * details of text trimming. - *

- * - * @param name the name of the child - * @param ns the namespace of the child - * @return trimmed text content for the named child, or null if none - */ - public String getChildTextTrim(String name, Namespace ns) { - Element child = getChild(name, ns); - if (child == null) { - return null; - } else { - return child.getTextTrim(); - } - } - - /** - *

* This sets the content of the element to be the text given. * All existing text content and non-text context is removed. * If this element should have both textual content and nested @@ -1748,24 +1669,24 @@ } /** + *

+ * This removes the supplied Attribute should it exist. + *

+ * + * @param attribute Reference to the attribute to be removed. + * @return whether the attribute was removed + */ + public boolean removeAttribute(Attribute attribute) { + if (attributes == null || + (attribute == null) || (attribute.getParent() != this)) { + return false; + } + + return attributes.remove(attribute); + } + + /** *

- * This removes the supplied Attribute should it exist. - *

- * - * @param attribute Reference to the attribute to be removed. - * @return whether the attribute was removed - */ - public boolean removeAttribute(Attribute attribute) { - if (attributes == null || - (attribute == null) || (attribute.getParent() != this)) { - return false; - } - - return attributes.remove(attribute); - } - - /** - *

* This returns a String representation of the * Element, suitable for debugging. If the XML * representation of the Element is desired,