144 public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array())
146 $this->elements[] = $element;
148 list($content_model_type, $content_model) = $this->
parseContents($contents);
162 if (!is_string($contents)) {
163 $this->info[$element]->child = $contents;
165 return $this->info[$element];
176 if (!isset($this->info[$element])) {
177 $this->elements[] = $element;
179 $this->info[$element]->standalone =
false;
181 trigger_error(
"Definition for $element already exists in module, cannot redefine");
183 return $this->info[$element];
194 if (!isset($this->content_sets[$type])) {
195 $this->content_sets[$type] =
'';
197 $this->content_sets[$type] .=
' | ';
199 $this->content_sets[$type] .= $element;
214 if (!is_string($contents)) {
215 return array(null, null);
220 return array(
'empty',
'');
222 return array(
'optional',
'Inline | #PCDATA');
224 return array(
'optional',
'Flow | #PCDATA');
226 list($content_model_type, $content_model) = explode(
':', $contents);
227 $content_model_type = strtolower(trim($content_model_type));
228 $content_model = trim($content_model);
229 return array($content_model_type, $content_model);
240 if (!is_array($attr_includes)) {
241 if (empty($attr_includes)) {
242 $attr_includes = array();
244 $attr_includes = array($attr_includes);
247 $attr[0] = $attr_includes;
260 if (is_string($list)) {
261 $list = func_get_args();
264 foreach ($list as $value) {
265 if (is_null($value)) {