This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Using the xsl:if correctly
- To: xsl-list at mulberrytech dot com
- Subject: Re: Using the xsl:if correctly
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Fri, 11 Feb 2000 18:31:42 GMT
- References: <0D50C43B7C72D111881500805FBB0C6B39C639@den-fps.dci>
- Reply-To: xsl-list at mulberrytech dot com
> desired XSL:
> ???
who knows?
Your question wasn't very explict
If the question is how to get from the "current XSL" to the
"desired XML" why does the `current XSL' generate the html
markup <td> <INPUT etc that isn't in your desired output.
However beware your test
<xsl:if test="@in_textarea">
is true if the current element has an in_textarea attribute, even if it
has the value "false".
probably you want something like
bash-2.01$ xt col.xml col.xsl
<?xml version="1.0" encoding="utf-8"?>
<column name="model" type="String" description="Auto Model" field_type="textbox">Mustang</column>
<column name="vintag" type="String" description="VIN Number" field_type="textarea">abc</column>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="column">
<xsl:copy>
<xsl:copy-of select="@*[not(starts-with(name(.), 'in_'))]"/>
<xsl:attribute name="field_type">
<xsl:value-of
select="substring-after(name(@*[starts-with(name(.), 'in_')
and normalize-space(.)='true']),'in_')"/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list