|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: relatively new to XSL- variable setting question
Bruce,
At 06:46 PM 10/6/2003, Bruce you wrote: Replying to my own post... a simpler way to ask my question is: - is there a way to test if an element contains a given node (ColData[@colID='5']? -- then I can make my variable statement conditional instead of it's value, as one can't reset a variables value in XSL apparently.. You're on the right track: <xsl:variable name="testVar">
<xsl:choose>
<xsl:test if="@colID=5">
<xsl:value-of select="@value"/>
</xsl:test>
<xsl:otherwise>99999</xsl:otherwise>
</xsl:choose>
</xsl:variable>Or sometimes there are more concise ways to achieve the behavior you want: <input type="hidden" name="varPass" value="99999"> <xsl:copy-of select="@value[current()/@colID=5]"/> </input> No variable needed -- value defaults to 99999 unless your colID is 5, in which case @value is copied. Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== 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








