221 |
} |
} |
222 |
} |
} |
223 |
|
|
224 |
|
/** |
225 |
|
* This method turns on the automatic wrapping |
226 |
|
* of the tag's content inside the CDATA wrapper |
227 |
|
* for XML |
228 |
|
* |
229 |
|
* @param boolean $flag TRUE or FALSE |
230 |
|
*/ |
231 |
|
function set_cdata_flag($flag) { |
232 |
|
if ($flag) { |
233 |
|
$this->_flags |= _CDATACONTENTWRAP; |
234 |
|
$this->set_collapse(TRUE); |
235 |
|
} else{ |
236 |
|
$this->_flags &= ~_CDATACONTENTWRAP; |
237 |
|
} |
238 |
|
} |
239 |
|
|
240 |
/** |
/** |
241 |
* This function turns on the collapse flag |
* This function turns on the collapse flag |
242 |
* |
* |
277 |
$this->_flags &= ~_NEWLINEAFTEROPENTAG; |
$this->_flags &= ~_NEWLINEAFTEROPENTAG; |
278 |
} |
} |
279 |
} |
} |
280 |
} |
} else if ($this->count_content() == 0) { |
281 |
|
$this->_flags &= ~(_CONTENTREQUIRED | _CLOSETAGREQUIRED); |
282 |
|
} |
283 |
} |
} |
284 |
} |
} |
285 |
|
|
308 |
$this->_tag = strtoupper($this->_tag); |
$this->_tag = strtoupper($this->_tag); |
309 |
} |
} |
310 |
//save on mem |
//save on mem |
311 |
$xml = $indent . ($this->_tag_prefix ? $this->_tag_prefix : _TAG_PREFIX) . $this->_tag; |
$xml = $indent . (@$this->_tag_prefix ? $this->_tag_prefix : _TAG_PREFIX) . $this->_tag; |
312 |
|
|
313 |
foreach( $this->_attributes as $name => $value) { |
foreach( $this->_attributes as $name => $value) { |
314 |
$xml .= $this->_build_attribute_string($name, $value); |
$xml .= $this->_build_attribute_string($name, $value); |
316 |
|
|
317 |
if ( !($this->_flags & _CLOSETAGREQUIRED) && !($this->_flags & _NOFINISHSLASHXHTML) |
if ( !($this->_flags & _CLOSETAGREQUIRED) && !($this->_flags & _NOFINISHSLASHXHTML) |
318 |
&& $finish_slash ) { |
&& $finish_slash ) { |
319 |
$xml .= " /".($this->_tag_postfix ? $this->_tag_postfix : _TAG_SUFFIX); |
$xml .= " /".(@$this->_tag_postfix ? $this->_tag_postfix : _TAG_SUFFIX); |
320 |
} else { |
} else { |
321 |
$xml .= ($this->_tag_postfix ? $this->_tag_postfix : _TAG_SUFFIX); |
$xml .= (@$this->_tag_postfix ? $this->_tag_postfix : _TAG_SUFFIX); |
322 |
} |
} |
323 |
|
|
324 |
if ($this->_flags & _NEWLINEAFTEROPENTAG) { |
if ($this->_flags & _NEWLINEAFTEROPENTAG) { |
361 |
} else { |
} else { |
362 |
$indent = $indent_level + 1; |
$indent = $indent_level + 1; |
363 |
} |
} |
364 |
$indent = $this->_render_indent($indent + 1); |
$indent = $this->_render_indent($indent); |
365 |
if ($this->_flags & _NEWLINEAFTEROPENTAG) { |
if ($this->_flags & _NEWLINEAFTEROPENTAG) { |
366 |
$item = str_replace("\n", "\n" . $indent, $item); |
$item = str_replace("\n", "\n" . $indent, $item); |
367 |
$xml .= $indent . $item . "\n"; |
$xml .= $indent . $item . "\n"; |
422 |
* to be added to the tag. |
* to be added to the tag. |
423 |
*/ |
*/ |
424 |
function _build_attribute_string($name, $value) { |
function _build_attribute_string($name, $value) { |
425 |
if ( ((int)$name - 0) === $name) { |
return " ".$name."=\"".$value."\""; |
|
$returnval = " ".$value; |
|
|
} else if ( $value === NULL ) { |
|
|
$returnval = " ".$name; |
|
|
} else { |
|
|
$returnval= " ".$name."=\"".$value."\""; |
|
|
} |
|
|
return $returnval; |
|
426 |
} |
} |
427 |
} |
} |
428 |
?> |
?> |