|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Legal Match ?
Hi Karl, > Is this a legal match? > <xsl:apply-templates select="z:row[@CreditStatus='$CREDIT_STATUS;']"/> > > Where $CREDIT_STATUS is a global variable. It wouldn't matter whether you had a $CREDIT_STATUS global variable or not -- the 's around $CREDIT_STATUS mean that you're just selecting those z:row elements whose CreditStatus attribute has the string value "$CREDIT_STATUS;". If you meant: <xsl:apply-templates select="z:row[@CreditStatus = $CREDIT_STATUS]"/> then yes, that's legal, and it *selects* (not matches) those z:row elements whose CreditStatus attribute's value is the same as the value of the $CREDIT_STATUS variable. > If so... what does the template rule look like? Something like: > > <xsl:template match="z:row[@CreditStatus='$CREDIT_STATUS;']> > .... > </xsl:template match> You're not allowed to refer to variables within the match attribute of <xsl:template> in XSLT 1.0 (XSLT 2.0 lifts this restriction). But as long as you only apply templates to the z:row elements that you're interested in, that shouldn't matter; you can match them with a variety of templates, but it's most likely that you'll want to do: <!-- match all z:row elements --> <xsl:template match="z:row">...</xsl:template> or: <!-- match those z:row elements with a CreditStatus attribute --> <xsl:template match="z:row[@CreditStatus]">...</xsl:template> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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








