Class XMLTagClass

Description

This class is used for building and rendering an XML tag.

This class is the base class for the HTMLTagClass.

This is part of the phphtmllib libraries released under the LGPL license.

Located in Program_Root/XMLTagClass.inc (line 35)

Container
   |
   --XMLTagClass
Direct descendents
Class Description
HTMLTagClass Base class for all HTML Tag classes.
SVGTagClass This overrides the WMLTagClass to define some methods that set some commonly used SVG tag attributes.
WMLTagClass Base class for all WML Tag classes.
XMLtag xml tag class
Method Summary
void XMLTagClass (string $name, [array $attributes = array()], mixed 2)
string get_tag ()
string get_tag_name ()
void render (int $indent_level)
void reset_attributes ([array $attributes = array()])
void set_cdata_flag (boolean $flag)
void set_collapse ([boolean $collapse = TRUE], [boolean $indent = TRUE])
void set_newline_after_closetag (boolean $flag)
void set_newline_after_opentag (boolean $flag)
void set_tag_attribute (string $name, [mixed $value = NULL])
void set_tag_attributes ([array $attributes = array()])
void set_tag_name (string $name)
the _build_attribute_string (string $name, mixed $value)
mixed _get_element (int $cell)
void _prepare_flags ()
void _render_close_tag (int $indent_level)
void _render_content (int $indent_level, mixed $output_debug)
void _render_open_tag (int $indent_level, [boolean $finish_slash = TRUE])
void _set_flags ()
Variables

Inherited Variables

Inherited from Container

Container::$_flags
Methods
Constructor XMLTagClass (line 68)

The constructor

void XMLTagClass (string $name, [array $attributes = array()], mixed 2)
  • mixed 2:

    - n items of content to add

  • string $name:

    - the tag name

  • array $attributes:

    - the attributes array can be in name => value or just value

get_tag (line 147)

This returns the tag declared for this class.

This should be used in favor of accessing the $this->_tag directly.

  • return:

    - the _tag var for this class.

string get_tag ()
get_tag_name (line 136)

This method gets the name of the tag

  • return:

    - the tag name

string get_tag_name ()
render (line 89)

This function is responsible for rendering the tag and its contents

void render (int $indent_level)
  • int $indent_level:

    - the current indentation level for the tag


Redefinition of:
Container::render()
This function is compatible with the rest of the phpHtmllib API spec.

Redefined in descendants as:
reset_attributes (line 180)

clear all attributes and start with new attributes

  • access: public
void reset_attributes ([array $attributes = array()])
  • array $attributes:

    Associative array of name="value" pairs of tag atributes. ie array("border"=>"0", "class"=>"hover");

set_cdata_flag (line 231)

This method turns on the automatic wrapping of the tag's content inside the CDATA wrapper for XML

void set_cdata_flag (boolean $flag)
  • boolean $flag:

    TRUE or FALSE

set_collapse (line 247)

This function turns on the collapse flag

void set_collapse ([boolean $collapse = TRUE], [boolean $indent = TRUE])
  • boolean $collapse:

    - the collapse flag

  • boolean $indent:

    - the indent flag DEFAULT: TRUE;


Redefinition of:
Container::set_collapse()
This function turns on the collapse flag
set_newline_after_closetag (line 216)

set the newline_after_content flag

void set_newline_after_closetag (boolean $flag)
  • boolean $flag:

    TRUE or FALSE

set_newline_after_opentag (line 204)

set the newline_after_opentag flag

void set_newline_after_opentag (boolean $flag)
  • boolean $flag:

    TRUE or FALSE

set_tag_attribute (line 158)

add a single attribute (name="value")

  • access: public
void set_tag_attribute (string $name, [mixed $value = NULL])
  • string $name:

    attribute name

  • mixed $value:

    the value.

set_tag_attributes (line 169)

add multiple attributes (name="value")

  • access: public
void set_tag_attributes ([array $attributes = array()])
  • array $attributes:

    Associative array of name="value" pairs of tag atributes. ie array("border"=>"0", "class"=>"hover");

set_tag_name (line 127)

This method sets the name of the tag

void set_tag_name (string $name)
  • string $name:

    - the tag name

_build_attribute_string (line 424)

this builds an attribute for an XML tag.

XML attributes MUST have a name AND a value.

  • return:

    tag attribute name=value pair. to be added to the tag.

the _build_attribute_string (string $name, mixed $value)
  • string $name:

    - $name attribute name

  • mixed $value:

    - $value attribute value


Redefined in descendants as:
_get_element (line 190)

get the nth element from content array

mixed _get_element (int $cell)
  • int $cell:

    the cell to get

_prepare_flags (line 270)

This function checks to see if

there is only 1 content data, and its not an object, then it auto sets some of the indentation flags

void _prepare_flags ()

Redefined in descendants as:
_render_close_tag (line 396)

this function is reposnsible for rendering the closing tag (if any)

void _render_close_tag (int $indent_level)
  • int $indent_level:

    - the indent level


Redefined in descendants as:
_render_content (line 339)

this function is reponsible for rendering the pcdata, or content of the tag (if any)

void _render_content (int $indent_level, mixed $output_debug)
  • int $indent_level:

    - the indent level

_render_open_tag (line 300)

this function is responsible for rendering the open tag.

void _render_open_tag (int $indent_level, [boolean $finish_slash = TRUE])
  • int $indent_level:

    - the indent level

  • boolean $finish_slash:

    - do we add the finish / if we have no close tag and no content?


Redefined in descendants as:

Inherited Methods

Inherited From Container

Container::Container()
Container::add()
Container::add_reference()
Container::count_content()
Container::get_indent_flag()
Container::push()
Container::push_reference()
Container::render()
Container::reset_content()
Container::set_collapse()
Container::set_indent_flag()
Container::_set_flags()

Documention generated on Thu, 31 Jul 2003 18:34:05 -0700 by phpDocumentor 1.2.0