Class XMLTag

(line 225)

Description


Located in File: /XMLParser.class.php

XML Tag Object (php5)

This object stores all of the direct children of itself in the $children array. They are also stored by type as arrays. So, if, for example, this tag had 2 <font> tags as children, there would be a class member called $font created as an array. $font[0] would be the first font tag, and $font[1] would be the second.

To loop through all of the direct children of this object, the $children member should be used.

To loop through all of the direct children of a specific tag for this object, it is probably easier to use the arrays of the specific tag names, as explained above.



Class Variables

Summary:
array $tagAttrs
array $tagChildren
stat $tagData
string $tagName

$tagAttrs (line 232)

Data type : array

Array with the attributes of this XML tag
  • access: - public

$tagChildren (line 255)

Data type : array

Array of references to the objects of all direct children of this XML object
  • access: - public

$tagData (line 248)

Data type : stat

The data the tag contains

So, if the tag doesn't contain child tags, and just contains a string, it would go here

  • access: - public

$tagName (line 239)

Data type : string

The name of the tag
  • access: - public

$tagParents (line 264)

Data type : int

The number of parents this XML object has (number of levels from this tag to the root tag)

Used presently only to set the number of tabs when outputting XML

  • access: - public

Class Constants

Summary:

Method Detail

Summary:
XMLTag __construct (string $name, [array $attrs = array()], [int $parents = 0])
void AddChild (string $name, array $attrs, int $parents, [bool $cleanTagName = true])
void Delete (string $childName, [int $childIndex = 0])
void DeleteChildren ()
string GetXML ()

Constructor __construct (line 274)

XMLTag __construct( string $name, [array $attrs = array()], [int $parents = 0])

Constructor, sets up all the default values

Parameters

  • string $name:
  • array $attrs:
  • int $parents:

Info

Method AddChild (line 298)

void AddChild( string $name, array $attrs, int $parents, [bool $cleanTagName = true])

Adds a direct child to this object

Parameters

  • string $name:
  • array $attrs:
  • int $parents:
  • bool $cleanTagName:

Info

  • access - public

Method Delete (line 396)

void Delete( string $childName, [int $childIndex = 0])

Deletes this tag's child with a name of $childName and an index of $childIndex

Parameters

  • string $childName:
  • int $childIndex:

Info

  • access - public

Method DeleteChildren (line 419)

void DeleteChildren( )

Removes all of the children of this tag in both name and value

Info

  • access - private

Method GetXML (line 347)

string GetXML( )

Returns the string of the XML document which would be generated from this object

This function works recursively, so it gets the XML of itself and all of its children, which in turn gets the XML of all their children, which in turn gets the XML of all thier children, and so on. So, if you call GetXML from the document root object, it will return a string for the XML of the entire document.

This function does not, however, return a DTD or an XML version/encoding tag. That should be handled by XMLParser::GetXML()

Info

  • access - public

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary


Documentation generated on Tue, 22 Dec 2009 09:42:53 +0100 by phpDocumentor 1.4.1