PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TXmlElement

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

TComponent
Extended by TXmlElement

Direct known subclasses

TXmlDocument
Package: System\Xml
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Xml/TXmlDocument.php
Methods summary
public
# __construct( string $tagName )

Constructor.

Constructor.

Parameters

$tagName
string
tag-name for this element

Overrides

TComponent::__construct()
public TXmlElement
# getParent( )

Returns

TXmlElement
parent element of this element
public
# setParent( TXmlElement $parent )

Parameters

$parent
TXmlElement
parent element of this element
public string
# getTagName( )

Returns

string
tag-name of this element
public
# setTagName( string $tagName )

Parameters

$tagName
string
tag-name of this element
public string
# getValue( )

Returns

string
text enclosed between opening and closing tag of this element
public
# setValue( string $value )

Parameters

$value
string
text enclosed between opening and closing tag of this element
public boolean
# getHasElement( )

Returns

boolean
true if this element has child elements
public boolean
# getHasAttribute( )

Returns

boolean
true if this element has attributes
public string
# getAttribute( mixed $name )

Returns

string
the attribute specified by the name, null if no such attribute
public
# setAttribute( string $name, string $value )

Parameters

$name
string
attribute name
$value
string
attribute value
public TXmlElementList
# getElements( )

Returns

TXmlElementList
list of child elements
public TMap
# getAttributes( )

Returns

TMap
list of attributes
public TXmlElement
# getElementByTagName( mixed $tagName )

Returns

TXmlElement
the first child element that has the specified tag-name, null if not found
public TList
# getElementsByTagName( mixed $tagName )

Returns

TList
list of all child elements that have the specified tag-name
public string
# toString( mixed $indent = 0 )

Returns

string
string representation of this element
public string
# __toString( )

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

$element = new TXmlElement('tag');
echo $element;

or

$element = new TXmlElement('tag');
$xml = (string)$element;

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

$element = new TXmlElement('tag');
echo $element;

or

$element = new TXmlElement('tag');
$xml = (string)$element;

Returns

string
string representation of this element
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO