com.borland.starteam.xml
Class XMLElement

java.lang.Object
  |
  +--com.borland.starteam.xml.XMLElement

public class XMLElement
extends java.lang.Object

An element in an XML document.

See Also:
XMLDocument.getRootElement()

Method Summary
 XMLAttribute[] getAttributes()
          Gets the list of attributes associated with this element, in no particular order.
 java.lang.String getAttributeValue(java.lang.String name)
          Gets the value of the attribute with the given name (and that does not belong to a namespace).
 XMLElement getChild(java.lang.String name)
          Gets the first child element nested directly within this element that has the given name (and does not belong to a namespace).
 XMLElement[] getChildren()
          Gets a list of all the child elements nested directly (that is, one level deep) within this element.
 XMLElement[] getChildren(java.lang.String name)
          Gets a list of all the child elements nested directly (that is, one level deep) within this element whose names match the given name (and that do not belong to a namespace).
 java.lang.String getName()
          Gets the local name of this element (that is, without a namespace prefix).
 java.lang.String getQualifiedName()
          Gets the qualified name of this element, in the form [namespace]:[name].
 java.lang.String getText()
          Gets the textual content directly held under this element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Gets the local name of this element (that is, without a namespace prefix).

Returns:
The local name of this element.

getQualifiedName

public java.lang.String getQualifiedName()
Gets the qualified name of this element, in the form [namespace]:[name]. If this element does not belong to a namespace, then the qualified name is the same as the local name.

Returns:
The qualified name of this element.

getChildren

public XMLElement[] getChildren()
Gets a list of all the child elements nested directly (that is, one level deep) within this element. If this element has no child elements, an empty list is returned.

Returns:
A list of all the direct child elements of this element.

getChildren

public XMLElement[] getChildren(java.lang.String name)
Gets a list of all the child elements nested directly (that is, one level deep) within this element whose names match the given name (and that do not belong to a namespace). If this element has no such child elements, an empty list is returned.

Parameters:
name - The element name.
Returns:
A list of all the direct child elements with the given name.

getChild

public XMLElement getChild(java.lang.String name)
Gets the first child element nested directly within this element that has the given name (and does not belong to a namespace). If this element has no such children, then null is returned.

Returns:
The first child element with the given name, or null.

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String name)
Gets the value of the attribute with the given name (and that does not belong to a namespace). If this element has no such attribute, then null is returned.

Parameters:
name - The attribute name.
Returns:
The value of the attribute, or null.

getAttributes

public XMLAttribute[] getAttributes()
Gets the list of attributes associated with this element, in no particular order.

Returns:
The attributes associated with this element, or an empty array if there are none.

getText

public java.lang.String getText()
Gets the textual content directly held under this element. This includes all text within this single element, including whitespace and CDATA sections if they exist. It's essentially the concatenation of all Text and CDATA nodes contained in this element. The call does not recurse into child elements. If no text exists within this element, an empty string is returned.

Returns:
The textual content of this element.


StarTeam SDK 10.0, Build 58
Copyright © 2003-2004 Borland Software Corporation. All rights reserved.