Public Member Functions | |
| XML2DOM ($a_xml) | |
| clean (&$attr) | |
| startElement ($a_parser, $a_name, $a_attrs) | |
| endElement ($a_parser, $a_name) | |
| characterData ($a_parser, $a_data) | |
| insertNode (&$dom, &$node) | |
Definition at line 108 of file class.ilXML2DOM.php.
| XML2DOM::characterData | ( | $ | a_parser, | |
| $ | a_data | |||
| ) |
Definition at line 165 of file class.ilXML2DOM.php.
References $GLOBALS.
{
$a_data = preg_replace("/&/","&",$a_data);
$GLOBALS["lastObj"]->setContent($a_data);
}
| XML2DOM::clean | ( | &$ | attr | ) |
Definition at line 128 of file class.ilXML2DOM.php.
Referenced by startElement().
{
if(is_array($attr))
{
foreach($attr as $key => $value)
{
$attr[$key] = preg_replace("/&(?!amp;|lt;|gt;|quot;)/","&",$attr[$key]);
$attr[$key] = preg_replace("/\"/",""",$attr[$key]);
$attr[$key] = preg_replace("/</","<",$attr[$key]);
$attr[$key] = preg_replace("/>/",">",$attr[$key]);
}
}
return $attr;
}
Here is the caller graph for this function:| XML2DOM::endElement | ( | $ | a_parser, | |
| $ | a_name | |||
| ) |
Definition at line 160 of file class.ilXML2DOM.php.
References $GLOBALS.
{
$GLOBALS["lastObj"]->setParent();
}
| XML2DOM::insertNode | ( | &$ | dom, | |
| &$ | node | |||
| ) |
Definition at line 172 of file class.ilXML2DOM.php.
References $dom.
{
$node = $this->xmlStruct->insert($dom, $node);
}
| XML2DOM::startElement | ( | $ | a_parser, | |
| $ | a_name, | |||
| $ | a_attrs | |||
| ) |
Definition at line 144 of file class.ilXML2DOM.php.
References $GLOBALS, and clean().
{
if (!is_object($this->xmlStruct))
{
#vd($a_attrs);
$this->xmlStruct = new XMLStruct($a_name, $a_attrs);
$GLOBALS["lastObj"] =& $this->xmlStruct;
}
else
{
$a_attrs = $this->clean($a_attrs);
#var_dump("<pre>",++$counter," ",$a_name," -> ",$a_attrs,"<pre>");
$GLOBALS["lastObj"]->append($a_name, $a_attrs);
}
}
Here is the call graph for this function:| XML2DOM::XML2DOM | ( | $ | a_xml | ) |
Definition at line 111 of file class.ilXML2DOM.php.
{
$xml_parser = xml_parser_create("UTF-8");
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);
xml_set_object($xml_parser, $this);
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!xml_parse($xml_parser, $a_xml, true))
{
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
xml_parser_free($xml_parser);
}
1.7.1