[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Anything that doesn't have the xsl: prefix is not part of XSLT - and is considered to be merely literal text in the transformation.
is a template of what you want in the result tree when the condition is true. Recall that XSLT is for transformation of the XML input to something else (XML, XHTML, HTML, text, etc.). What you want to transform to is by way of an "example" or "template" of what you want.
The above is "just literal text" - except for the value of the attribute value template {@rate-increase} - that you are using to select the value of the attribute "rate-increase" from your input XML. Whatever the current node is - this is the value of the attribute named rate-increase attached to that node.
Based on the info you supply - it is a bit of a mystery why you get what you do. However, since it does happen - I would work backward from there and determine the conditions under which you will get that output (since you do - it will be so). Typically you will find that something other than what you think is happening to be so.
----- Original Message ----- From: "Oleg Konovalov" <olegkon@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, December 13, 2006 2:07 PM
Subject: [xsl] Option mystery
Re: [xsl] Option mystery
Subject: Re: [xsl] Option mystery From: "CyberSpace Industries 2000 Inc." <csi2000@xxxxxxxxxxxxxxx> Date: Wed, 13 Dec 2006 15:34:06 -0500 |
Anything that doesn't have the xsl: prefix is not part of XSLT - and is considered to be merely literal text in the transformation.
<option rate-increase="{@rate-increase}"> <debug1>branch1</debug1> ...other elements </option>
is a template of what you want in the result tree when the condition is true. Recall that XSLT is for transformation of the XML input to something else (XML, XHTML, HTML, text, etc.). What you want to transform to is by way of an "example" or "template" of what you want.
The above is "just literal text" - except for the value of the attribute value template {@rate-increase} - that you are using to select the value of the attribute "rate-increase" from your input XML. Whatever the current node is - this is the value of the attribute named rate-increase attached to that node.
Based on the info you supply - it is a bit of a mystery why you get what you do. However, since it does happen - I would work backward from there and determine the conditions under which you will get that output (since you do - it will be so). Typically you will find that something other than what you think is happening to be so.
Cheers...Hugh CyberSpace Industries 2000 Inc. XML Training and Consulting
----- Original Message ----- From: "Oleg Konovalov" <olegkon@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, December 13, 2006 2:07 PM
Subject: [xsl] Option mystery
Hi, I am trying to fix a bug in somebody else's XSLT1.0/Cocoon2.0.4 app. I encountered something in the code which I don't understand.
<xsl:choose> <xsl:when test="$tier/option[option-num=$cur-option-num and @rate-increase='true']"> <option rate-increase="{@rate-increase}"> <debug1>branch1</debug1> ...other elements </option> </xsl:when> </xsl:choose>
A few questions regarding snippet: 1) is that "option" a predefined XSLT1.0 construct / keyword / operation ? I can't find any in the XSLT book. Could you please explain it to me what that is (in details).
2) the bug I am trying to fix is that somehow on exit I am getting a node with <option rate-increase="false"> (that debug1=branch1 and option-num=1). How is that possible ? That "branch1" is unique and can't come from any other place. How can that expression inside [] fail ?
Sorry for the newbie questions.
Thank you in advance, Oleg.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Option mystery, Oleg Konovalov | Thread | Re: [xsl] Option mystery, Kamal Bhatt |
RE: [xsl] Problem with Xpath, ms | Date | RE: RE: [xsl] Problem with Xpath, cknell |
Month |