130 public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) {
131 $this->elements[] = $element;
133 list($content_model_type, $content_model) = $this->
parseContents($contents);
140 $content_model, $content_model_type, $attr
143 if (!is_string($contents)) $this->info[$element]->child = $contents;
144 return $this->info[$element];
154 if (!isset($this->info[$element])) {
155 $this->elements[] = $element;
157 $this->info[$element]->standalone =
false;
159 trigger_error(
"Definition for $element already exists in module, cannot redefine");
161 return $this->info[$element];
171 if (!isset($this->content_sets[$type])) $this->content_sets[$type] =
'';
172 else $this->content_sets[$type] .=
' | ';
173 $this->content_sets[$type] .= $element;
186 if (!is_string($contents))
return array(null, null);
190 return array(
'empty',
'');
192 return array(
'optional',
'Inline | #PCDATA');
194 return array(
'optional',
'Flow | #PCDATA');
196 list($content_model_type, $content_model) = explode(
':', $contents);
197 $content_model_type = strtolower(trim($content_model_type));
198 $content_model = trim($content_model);
199 return array($content_model_type, $content_model);
209 if (!is_array($attr_includes)) {
210 if (empty($attr_includes)) $attr_includes = array();
211 else $attr_includes = array($attr_includes);
213 $attr[0] = $attr_includes;
225 if (is_string($list)) $list = func_get_args();
227 foreach ($list as $value) {
228 if (is_null($value))
continue;