Definition at line 85 of file class.ilXML2DOM.php.
◆ __construct()
XML2DOM::__construct |
( |
|
$a_xml | ) |
|
Definition at line 87 of file class.ilXML2DOM.php.
89 $xml_parser = xml_parser_create(
"UTF-8");
90 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
false);
91 xml_set_object($xml_parser, $this);
92 xml_set_element_handler($xml_parser,
"startElement",
"endElement");
93 xml_set_character_data_handler($xml_parser,
"characterData");
95 if (!xml_parse($xml_parser, $a_xml,
true)) {
97 "XML error: %s at line %d",
98 xml_error_string(xml_get_error_code($xml_parser)),
99 xml_get_current_line_number($xml_parser)
102 xml_parser_free($xml_parser);
◆ characterData()
XML2DOM::characterData |
( |
|
$a_parser, |
|
|
|
$a_data |
|
) |
| |
Definition at line 137 of file class.ilXML2DOM.php.
References $GLOBALS.
139 $a_data = preg_replace(
"/&/",
"&", $a_data);
141 $GLOBALS[
"lastObj"]->setContent($a_data);
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
◆ clean()
XML2DOM::clean |
( |
& |
$attr | ) |
|
Definition at line 105 of file class.ilXML2DOM.php.
References $key.
107 if (is_array($attr)) {
108 foreach ($attr as
$key => $value) {
109 $attr[
$key] = preg_replace(
"/&(?!amp;|lt;|gt;|quot;)/",
"&", $attr[
$key]);
110 $attr[
$key] = preg_replace(
"/\"/",
""", $attr[
$key]);
111 $attr[
$key] = preg_replace(
"/</",
"<", $attr[
$key]);
112 $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 119 of file class.ilXML2DOM.php.
References $GLOBALS, and clean().
121 if (!is_object($this->xmlStruct)) {
123 $this->xmlStruct =
new XMLStruct($a_name, $a_attrs);
124 $GLOBALS[
"lastObj"] = &$this->xmlStruct;
126 $a_attrs = $this->
clean($a_attrs);
127 #var_dump("<pre>",++$counter," ",$a_name," -> ",$a_attrs,"<pre>"); 128 $GLOBALS[
"lastObj"]->append($a_name, $a_attrs);
Class for creating an object (new node) by parsing XML code and adding it to an existing DOM object...
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
The documentation for this class was generated from the following file: