Re: [xslt] Re: <?php ... ?> and <xsl:output method="html">



Am Freitag, 5. Dezember 2003 14:22 schrieb csg:
>
> To embed PHP code in HTML generated from XML using XSLT (xsltproc),
> I do this:
>
>   - On the XML side I use a XML tag reserved for this task
>     (for instance, here I use "PHP" for this). In this tag the
>     markup containing PHP "processing instructions" (which in
>     reality are no valid PM's) ist quoted through a CDATA
>     section:
>
>       <PHP><![CDATA[<input type="text" name="subject" value="<?php
> echo $_GET['subject']; ?>"> </input>]]></PHP>
>
>   - Inside XSLT I have defined a special template for this PHP tag:
>
>       <xsl:template match="PHP">
>         <xsl:value-of disable-output-escaping="yes" select="." />
>       </xsl:template>
>
> Thats all - the result is valid and working PHP-HTML...

But the source XML doesn't validate anymore against a given DTD 
Because of the <PHP> elements. 

kind regards
janning

-----------------------
PLANWERK 6 
websolutions

Herzogstraße 85
40215 Düsseldorf

fon 0211 - 601 59 19
fax 0211 - 601 59 17

vygen@planwerk6.de
http://www.planwerk6.de
-----------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]