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:41:41 @@ -73,6 +73,7 @@ * @author Kevin Regan * @author Dan Schaffer * @author Yusuf Goolamabbas + * @author Kent C. Johnson * @version 1.0 */ public class Element implements Serializable, Cloneable { @@ -706,6 +707,26 @@ /** *

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

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

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

@@ -746,6 +767,27 @@ /** *

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

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

* 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 +1790,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,