[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: Using the xsl:if correctly
Subject: Re: Using the xsl:if correctly From: David Carlisle <davidc@xxxxxxxxx> Date: Fri, 11 Feb 2000 18:31:42 GMT |
> 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Using the xsl:if correctly, Steve Tinney | Thread | RE: Using the xsl:if correctly, Kerry Nice (DEN) |
Re: Using the xsl:if correctly, Steve Tinney | Date | Re: Combining XSL with DTDs, Wendell Piez |
Month |