[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
steve tinney auto
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.