This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Outputting literal and 'quoted' tags.


Mike Brown wrote:

> True, generating something that is not even valid HTML is impossible
> without resorting to text mode or disable-output-escaping hacks. I
> would question the need to generate such code, though.
>
> You could easily generate this:
>
> <?php if ($value == 'yes') { ?>
>   <input type="checkbox" name="{@id}" value="yes" checked="checked"/>
> <?php } else { ?>
>   <input type="checkbox" name="{@id}" value="yes"/>
> <?php } ?>
>
> with this:
>
> <xsl:processing-instruction name="php">
>   <xsl:text>if ($value == 'yes') { </xsl:text>
> </xsl:processing-instruction>
> <input type="checkbox" name="{@id}" value="yes" checked="checked"/>
> <xsl:processing-instruction name="php">
>   <xsl:text>} else { </xsl:text>
> </xsl:processing-instruction>
> <input type="checkbox" name="{@id}" value="yes"/>
> <xsl:processing-instruction name="php">
>   <xsl:text>} </xsl:text>
> </xsl:processing-instruction>

True, but there are several spots where it gets lots more complex than
this (constructing tables form the input, for example. But point well
taken.

Emile



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]