Subject: Re: [xsl] Outputting literal and 'quoted' tags. From: Mike Brown <mike@xxxxxxxx> Date: Wed, 5 Dec 2001 10:52:14 -0700 (MST) |
Emiliano wrote: > > I thought php had an xml friendly syntax these days that didn't require > > that you placed <? inside markup. > > It doesn't strictly require you to, but I don't see how else I would > achieve the wanted result of there being > > <input type="checkbox" name="{@id}" value="yes"<?php if ($value == 'yes') { echo " checked"; } ?>> > > in the output (with {@id} replaced by its value of course). 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> Just an idea... - Mike ____________________________________________________________________________ mike j. brown, fourthought.com | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | personal: http://hyperreal.org/~mike/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Outputting literal and 'q, Emiliano | Thread | Re: [xsl] Outputting literal and 'q, Emiliano |
Re: [xsl] & in xml data, Tim Gray | Date | RE: [xsl] Outputting literal and 'q, Stuart Celarier |
Month |