6 require_once(
"./Services/Xml/classes/class.ilSaxParser.php");
31 $this->style_obj = $a_style_obj;
33 parent::__construct($a_xml_file);
44 xml_set_object($a_xml_parser,$this);
45 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
46 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
54 $this->styles =
array();
55 parent::startParsing();
56 $this->style_obj->setStyle($this->styles);
57 $this->style_obj->setCharacteristics($this->chars);
70 $this->current_tag = $a_attribs[
"Tag"];
71 $this->current_class = $a_attribs[
"Class"];
72 $this->current_type = $a_attribs[
"Type"];
73 if ($this->current_class ==
"PageTitle" && $this->current_type ==
"page_title" && $this->current_tag ==
"div")
75 $this->current_tag =
"h1";
77 if ($this->current_class ==
"Headline1" && $this->current_tag ==
"div")
79 $this->current_tag =
"h1";
80 $this->current_type =
"heading1";
82 if ($this->current_class ==
"Headline2" && $this->current_tag ==
"div")
84 $this->current_tag =
"h2";
85 $this->current_type =
"heading2";
87 if ($this->current_class ==
"Headline3" && $this->current_tag ==
"div")
89 $this->current_tag =
"h3";
90 $this->current_type =
"heading3";
92 $this->current_tags =
array();
93 $this->chars[] =
array(
"type" => $this->current_type,
94 "class" => $this->current_class);
97 case "StyleParameter":
98 $this->current_tags[] =
array(
99 "tag" => $this->current_tag,
100 "class" => $this->current_class,
101 "parameter" => $a_attribs[
"Name"],
102 "type" => $this->current_type,
103 "value" => $a_attribs[
"Value"],
104 "custom" => $a_attribs[
"Custom"]);
108 $this->style_obj->addColor($a_attribs[
"Name"], $a_attribs[
"Code"]);
111 case "StyleTemplate":
112 $this->cur_template =
array(
"type" => $a_attribs[
"Type"],
113 "name" => $a_attribs[
"Name"]);
114 $this->cur_template_classes =
array();
117 case "StyleTemplateClass":
118 $this->cur_template_classes[$a_attribs[
"ClassType"]] =
135 $this->style_obj->setTitle($this->cdata);
139 $this->style_obj->setDescription($this->cdata);
143 $this->styles[] = $this->current_tags;
146 case "StyleTemplate":
147 $this->style_obj->addTemplate($this->cur_template[
"type"],
148 $this->cur_template[
"name"], $this->cur_template_classes);
163 $a_data = str_replace(
"<",
"<",$a_data);
164 $a_data = str_replace(
">",
">",$a_data);
167 $a_data = preg_replace(
"/\n/",
"",$a_data);
168 $a_data = preg_replace(
"/\t+/",
"",$a_data);
171 $this->cdata .= $a_data;
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
startParsing()
start the parser
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class private
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
__construct($a_xml_file, &$a_style_obj)
Constructor.
Create styles array
The data for the language used.
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
handlerEndTag($a_xml_parser, $a_name)
handler for end of element