## Class TXmlElement

Description

TXmlElement class.

TXmlElement represents an XML element node. You can obtain its tagname, attributes, text between the openning and closing tags via the TagName, Attributes, and Value properties, respectively. You can also retrieve its parent and child elements by Parent and Elements properties, respectively.

TBD: xpath

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Xml/TXmlDocument.php (line 29)

    TComponent
       |
       --TXmlElement

Direct descendents

Class | Description
--- | ---
TXmlDocument | TXmlDocument class.

Method Summary
TXmlElement __construct (string $tagName)
string getAttribute (mixed $name)
TMap getAttributes ()
TXmlElement getElementByTagName (mixed $tagName)
TXmlElementList getElements ()
TList getElementsByTagName (mixed $tagName)
boolean getHasAttribute ()
boolean getHasElement ()
TXmlElement getParent ()
string getTagName ()
string getValue ()
void setAttribute (string $name, string $value)
void setParent (TXmlElement $parent)
void setTagName (string $tagName)
void setValue (string $value)
string toString (mixed $indent)
Methods
Constructor __construct (line 56)

Constructor.

- access: public

TXmlElement __construct (string $tagName)

- string $tagName: tagname for this element

Redefined in descendants as:

- TXmlDocument::__construct() : Constructor.

getAttribute (line 128)

- return: the attribute specified by the name, null if no such attribute
- access: public

string getAttribute (mixed $name)
getAttributes (line 158)

- return: list of attributes
- access: public

TMap getAttributes ()
getElementByTagName (line 168)

- return: the first child element that has the specified tagname, null if not found
- access: public

TXmlElement getElementByTagName (mixed $tagName)
getElements (line 148)

- return: list of child elements
- access: public

TXmlElementList getElements ()
getElementsByTagName (line 182)

- return: list of all child elements that have the specified tagname
- access: public

TList getElementsByTagName (mixed $tagName)
getHasAttribute (line 120)

- return: true if this element has attributes
- access: public

boolean getHasAttribute ()
getHasElement (line 112)

- return: true if this element has child elements
- access: public

boolean getHasElement ()
getParent (line 64)

- return: parent element of this element
- access: public

TXmlElement getParent ()
getTagName (line 80)

- return: tagname of this element
- access: public

string getTagName ()
getValue (line 96)

- return: text enclosed between opening and closing tag of this element
- access: public

string getValue ()
setAttribute (line 140)

- access: public

void setAttribute (string $name, string $value)

- string $name: attribute name
- string $value: attribute value

setParent (line 72)

- access: public

void setParent (TXmlElement $parent)

- TXmlElement $parent: parent element of this element

setTagName (line 88)

- access: public

void setTagName (string $tagName)

- string $tagName: tagname of this element

setValue (line 104)

- access: public

void setValue (string $value)

- string $value: text enclosed between opening and closing tag of this element

toString (line 197)

- return: string representation of this element
- access: public

string toString (mixed $indent)

#### Inherited Methods

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Sun, 04 Jun 2006 19:00:49 -0400 by phpDocumentor 1.3.0RC4