There are lots of problems with XHTML parsing in PHP by XML functions.
I've just solved most of them. However, how to get value of attribute
with namespace?
<input type="checkbox" id="something" f3:var="config. item" />
<?php
foreach(xpath('//input[@id="ms"]') as $item) echo $item['f3:var'];
?>
It doesn't work. Even $f3->item['var'].
I wonder whether parsing XML using preg_* and str_* wouldn't better.
Though i'm only creating a template system. XML parsing is only used
for FORMS with IF conditions generating. Example output:
<input type="checkbox" id="something" <?php if($config['item']) echo
'checked="check ed" ';?>/>
OR:
<?php if($config['item']) echo '<input type="checkbox" id="something"
checked="checke d" />'; else echo '<input type="checkbox"
id="something" />'; ?>
There is only 1 (later maybe more) new attribute: f3:var - which can
be situated in <form(for all checkbox, radio and select) or in
input / select elements.
Give me some advices. What is better for this purpose - XML in PHP or
preg_* / str_*?
I've just solved most of them. However, how to get value of attribute
with namespace?
<input type="checkbox" id="something" f3:var="config. item" />
<?php
foreach(xpath('//input[@id="ms"]') as $item) echo $item['f3:var'];
?>
It doesn't work. Even $f3->item['var'].
I wonder whether parsing XML using preg_* and str_* wouldn't better.
Though i'm only creating a template system. XML parsing is only used
for FORMS with IF conditions generating. Example output:
<input type="checkbox" id="something" <?php if($config['item']) echo
'checked="check ed" ';?>/>
OR:
<?php if($config['item']) echo '<input type="checkbox" id="something"
checked="checke d" />'; else echo '<input type="checkbox"
id="something" />'; ?>
There is only 1 (later maybe more) new attribute: f3:var - which can
be situated in <form(for all checkbox, radio and select) or in
input / select elements.
Give me some advices. What is better for this purpose - XML in PHP or
preg_* / str_*?
Comment