Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TXmlElement

TComponent
   |
   --TXmlElement

Direct Known Sub-classes:

TXmlElement class.

TXmlElement represents an XML element node. You can obtain its tag-name, attributes, text between the opening 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
Author: Qiang Xue <qiang.xue@gmail.com>

Constructor Summary
public
__construct Array
Constructor.

Method Summary
string
getAttribute ( mixed $name)
TMap
TXmlElement
getElementByTagName ( mixed $tagName)
TXmlElementList
TList
getElementsByTagName ( mixed $tagName)
boolean
boolean
TXmlElement
string
string
void
setAttribute ( string $name, string $value)
void
setParent ( TXmlElement $parent)
void
setTagName ( string $tagName)
void
setValue ( string $value)
string
toString ( mixed $indent)
string
Magic-method override. Called whenever this element is used as a string.
Methods Inherited From TComponent
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Constructor Details

__construct

public __construct Array

Constructor.


Method Details

getAttribute

public string getAttribute (mixed $name )

Input
mixed$name
Output
string the attribute specified by the name, null if no such attribute
Exception

getAttributes

public TMap getAttributes ()

Output
TMap list of attributes
Exception

getElementByTagName

public TXmlElement getElementByTagName (mixed $tagName )

Input
mixed$tagName
Output
TXmlElement the first child element that has the specified tag-name, null if not found
Exception

getElements

public TXmlElementList getElements ()

Output
TXmlElementList list of child elements
Exception

getElementsByTagName

public TList getElementsByTagName (mixed $tagName )

Input
mixed$tagName
Output
TList list of all child elements that have the specified tag-name
Exception

getHasAttribute

public boolean getHasAttribute ()

Output
boolean true if this element has attributes
Exception

getHasElement

public boolean getHasElement ()

Output
boolean true if this element has child elements
Exception

getParent

public TXmlElement getParent ()

Output
TXmlElement parent element of this element
Exception

getTagName

public string getTagName ()

Output
string tag-name of this element
Exception

getValue

public string getValue ()

Output
string text enclosed between opening and closing tag of this element
Exception

setAttribute

public void setAttribute (string $name , string $value )

Input
string$nameattribute name
string$valueattribute value
Output
Exception

setParent

public void setParent (TXmlElement $parent )

Input
TXmlElement$parentparent element of this element
Output
Exception

setTagName

public void setTagName (string $tagName )

Input
string$tagNametag-name of this element
Output
Exception

setValue

public void setValue (string $value )

Input
string$valuetext enclosed between opening and closing tag of this element
Output
Exception

toString

public string toString (mixed $indent )

Input
mixed$indent
Output
string string representation of this element
Exception

__toString

public string __toString ()

Magic-method override. Called whenever this element is used as a string.

  1. $element = new TXmlElement('tag');
  2. echo $element;
or
  1. $element = new TXmlElement('tag');
  2. $xml = (string)$element;

Output
string string representation of this element
Exception