Re: yet another template
| From: | Paul Meagher | Date: | Wed, 07 Nov 2001 18:45:51 +0000 |
| Subject: | Re: yet another template | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-2619@lists.php.net to get a copy of this message | ||
> I definitely agree with you, XSLT is such a handy template system, and
> it's pretty easy to get the hang of.
>
> The problem is not that it requires XML output (that would make it
> rather useless), but that it requires XML input. If you are querying a
> standard OS database such as mysql, you'll have to put that XML input
> together yourself, perhaps using an ordinary template system. The
> problem there lies in that you'll be performing twice the
> transformations, which is just too much overhead.
From the PHP manual under XSLT:
1) you do : "select * from mytable"
2) then
---------------------------------------
$fld1=$result->fields[0]; // you can do "for" here :)
$fld_name1=$result->fieldname[0];// certainly fieldname function must
return field name
$myxml.="<$fld_name1>$fld1</fld_name1>"
---------------------------------------
3) write your xsl stylesheet to apply selected data.
4) Apply xsl to $myxml :)
Regards,
Paul
> I guess it comes down to the best tool for the job.
>
> Lux
>
>
> > --
> > PEAR Development Mailing List (http://pear.php.net/)
> > To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net
> > For additional commands, e-mail: pear-dev-help@lists.php.net
> > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> >
> >
> >
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: pear-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>