NVelocity.NAnt.Anakia
Class AnakiaXmlElement

A JDOM {@link Element} that is tailored for Anakia needs. It has {@link #selectNodes(String)} method as well as a {@link #toString()} that outputs the XML serialized form of the element. This way it acts in much the same way as a single-element {@link NodeList} would.

Properties inherited from class System.Xml.XmlElement
Attributes, HasAttributes, InnerText, InnerXml, IsEmpty, LocalName, Name, NamespaceURI, NextSibling, NodeType, OwnerDocument, Prefix

Properties inherited from class System.Xml.XmlLinkedNode
PreviousSibling

Properties inherited from class System.Xml.XmlNode
BaseURI, ChildNodes, FirstChild, HasChildNodes, IsReadOnly, Item, Item, LastChild, OuterXml, ParentNode, Value

Method Summary
System.Collections.IList GetAttributes()
         This returns the complete set of attributes for this element, as a
NodeList
of
Attribute
objects in no particular order, or an empty list if there are none. The returned list is "live" and changes to it affect the element's actual attributes.
System.Xml.XmlNode GetChild(string xpath)
System.Collections.IList GetChildren(string name, string ns)
         This returns a
NodeList
of all the child elements nested directly (one level deep) within this element with the given local name and belonging to the given Namespace, returned as
Element
objects. If this target element has no nested elements with the given name in the given Namespace, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents. Please see the notes for
{@link #getChildren}
for a code example.
System.Collections.IList GetChildren(string name)
         This returns a
NodeList
of all the child elements nested directly (one level deep) within this element with the given local name and belonging to no namespace, returned as
Element
objects. If this target element has no nested elements with the given name outside a namespace, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents. Please see the notes for
{@link #getChildren}
for a code example.
System.Collections.IList GetChildren()
         This returns a
NodeList
of all the child elements nested directly (one level deep) within this element, as
Element
objects. If this target element has no nested elements, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents. This performs no recursion, so elements nested two levels deep would have to be obtained with:
            Iterator itr = currentElement.getChildren().iterator();
            while (itr.hasNext()) {
            Element oneLevelDeep = (Element)nestedElements.next();
            List twoLevelsDeep = oneLevelDeep.getChildren();
            // Do something with these children
            }
            
System.Collections.IList GetContent()
         This returns the full content of the element as a NodeList which may contain objects of type
String
,
Element
,
Comment
,
ProcessingInstruction
,
CDATA
, and
EntityRef
. The List returned is "live" in document order and modifications to it affect the element's actual contents. Whitespace content is returned in its entirety.
string ToString()
         Returns the XML serialized form of this element, as produced by the default {@link XMLOutputter}.

Methods inherited from class System.Xml.XmlElement
CloneNode, GetAttribute, GetAttribute, GetAttributeNode, GetAttributeNode, GetElementsByTagName, GetElementsByTagName, HasAttribute, HasAttribute, RemoveAll, RemoveAllAttributes, RemoveAttribute, RemoveAttribute, RemoveAttributeAt, RemoveAttributeNode, RemoveAttributeNode, SetAttribute, SetAttribute, SetAttributeNode, SetAttributeNode, WriteContentTo, WriteTo

Methods inherited from class System.Xml.XmlNode
AppendChild, Clone, CreateNavigator, GetEnumerator, GetNamespaceOfPrefix, GetPrefixOfNamespace, ICloneable.Clone, IEnumerable.GetEnumerator, InsertAfter, InsertBefore, Normalize, PrependChild, RemoveChild, ReplaceChild, SelectNodes, SelectNodes, SelectSingleNode, SelectSingleNode, Supports

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone


Method Detail

GetAttributes

public System.Collections.IList GetAttributes()

This returns the complete set of attributes for this element, as a

NodeList
of
Attribute
objects in no particular order, or an empty list if there are none. The returned list is "live" and changes to it affect the element's actual attributes.

Returns:
attributes for the element

GetChild

public System.Xml.XmlNode GetChild(string xpath)


GetChildren

public System.Collections.IList GetChildren(string name,
                                            string ns)

This returns a

NodeList
of all the child elements nested directly (one level deep) within this element with the given local name and belonging to the given Namespace, returned as
Element
objects. If this target element has no nested elements with the given name in the given Namespace, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents. Please see the notes for
{@link #getChildren}
for a code example.

Parameters:
name - local name for the children to match
ns -
Namespace
to search within
Returns:
all matching child elements

GetChildren

public System.Collections.IList GetChildren(string name)

This returns a

NodeList
of all the child elements nested directly (one level deep) within this element with the given local name and belonging to no namespace, returned as
Element
objects. If this target element has no nested elements with the given name outside a namespace, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents. Please see the notes for
{@link #getChildren}
for a code example.

Parameters:
name - local name for the children to match
Returns:
all matching child elements

GetChildren

public System.Collections.IList GetChildren()

This returns a

NodeList
of all the child elements nested directly (one level deep) within this element, as
Element
objects. If this target element has no nested elements, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents. This performs no recursion, so elements nested two levels deep would have to be obtained with:
            Iterator itr = currentElement.getChildren().iterator();
            while (itr.hasNext()) {
            Element oneLevelDeep = (Element)nestedElements.next();
            List twoLevelsDeep = oneLevelDeep.getChildren();
            // Do something with these children
            }
            

Returns:
list of child
Element
objects for this element

GetContent

public System.Collections.IList GetContent()

This returns the full content of the element as a NodeList which may contain objects of type

String
,
Element
,
Comment
,
ProcessingInstruction
,
CDATA
, and
EntityRef
. The List returned is "live" in document order and modifications to it affect the element's actual contents. Whitespace content is returned in its entirety.

Returns:
a
List
containing the mixed content of the element: may contain
String
,
{@link Element}
,
{@link Comment}
,
{@link ProcessingInstruction}
,
{@link CDATA}
, and
{@link EntityRef}
objects.

ToString

public string ToString()

Returns the XML serialized form of this element, as produced by the default {@link XMLOutputter}.