Definition at line 88 of file class.ilXML2DOM.php.
◆ __construct()
XML2DOM::__construct |
( |
|
$a_xml | ) |
|
Definition at line 91 of file class.ilXML2DOM.php.
93 $xml_parser = xml_parser_create(
"UTF-8");
94 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
false);
95 xml_set_object($xml_parser, $this);
96 xml_set_element_handler($xml_parser,
"startElement",
"endElement");
97 xml_set_character_data_handler($xml_parser,
"characterData");
99 if (!xml_parse($xml_parser, $a_xml,
true))
101 die(sprintf(
"XML error: %s at line %d",
102 xml_error_string(xml_get_error_code($xml_parser)),
103 xml_get_current_line_number($xml_parser)));
105 xml_parser_free($xml_parser);
◆ characterData()
XML2DOM::characterData |
( |
|
$a_parser, |
|
|
|
$a_data |
|
) |
| |
Definition at line 145 of file class.ilXML2DOM.php.
References $GLOBALS.
147 $a_data = preg_replace(
"/&/",
"&",$a_data);
149 $GLOBALS[
"lastObj"]->setContent($a_data);
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
◆ clean()
XML2DOM::clean |
( |
& |
$attr | ) |
|
Definition at line 108 of file class.ilXML2DOM.php.
112 foreach($attr as $key => $value)
114 $attr[$key] = preg_replace(
"/&(?!amp;|lt;|gt;|quot;)/",
"&",$attr[$key]);
115 $attr[$key] = preg_replace(
"/\"/",
""",$attr[$key]);
116 $attr[$key] = preg_replace(
"/</",
"<",$attr[$key]);
117 $attr[$key] = preg_replace(
"/>/",
">",$attr[$key]);
◆ endElement()
XML2DOM::endElement |
( |
|
$a_parser, |
|
|
|
$a_name |
|
) |
| |
◆ insertNode()
XML2DOM::insertNode |
( |
& |
$dom, |
|
|
& |
$node |
|
) |
| |
◆ startElement()
XML2DOM::startElement |
( |
|
$a_parser, |
|
|
|
$a_name, |
|
|
|
$a_attrs |
|
) |
| |
Definition at line 124 of file class.ilXML2DOM.php.
References $GLOBALS.
126 if (!is_object($this->xmlStruct))
129 $this->xmlStruct =
new XMLStruct($a_name, $a_attrs);
130 $GLOBALS[
"lastObj"] =& $this->xmlStruct;
134 $a_attrs = $this->
clean($a_attrs);
135 #var_dump("<pre>",++$counter," ",$a_name," -> ",$a_attrs,"<pre>"); 136 $GLOBALS[
"lastObj"]->append($a_name, $a_attrs);
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Class for creating an object (new node) by parsing XML code and adding it to an existing DOM object...
The documentation for this class was generated from the following file: