|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using the xsl:if correctly
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








