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

RE: Re: Option mystery

Subject: RE: Re: Option mystery
From: cknell@xxxxxxxxxx
Date: Wed, 13 Dec 2006 14:40:19 -0500
RE: Re:  Option mystery
> 1) But how can there be 2 words in one root name, "option" & "rate-increase" ?

"option" is the name of the element.
The "@" that appears with "rate-increase" in your XPath is telling you that it is an attribute of <option>.

Look at the <xsl:when test=""> element for example. "xsl:when" is the name of the element (the "when" is the local part, the "xsl:" is the namespace part).

The "test" is an attribute, like "rate-increase".


> 2)  Yes, there is another "when" ...

Yes, I'm afraid I got out too much in front on that one.
Look at your template again,

<option rate-increase="{@rate-increase}">

You didn't show the "match" attribute for the template that encloses the the <xsl:choose>, but if you are getting an output that looks like this:

<option rate-increase="false"> 

then your template is matching an element with an attribute named "rate-increase" that has the value of "false".


-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Oleg Konovalov <olegkon@xxxxxxxxx>
Sent:     Wed, 13 Dec 2006 14:25:47 -0500
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Re:  Option mystery

1) But how can there be 2 words in one root name, "option" & "rate-increase" ?

2)  Yes, there is another "when" there, but it has another value of
debug=branch2 and doesn't show up in the output, so I don't think it is involved. Correct ?



On 12/13/06, cknell@xxxxxxxxxx <cknell@xxxxxxxxxx> wrote:
> > 1) is that "option" a predefined XSLT1.0 construct / keyword / operation ?
>
> No. "option" is the root element of an XML document stored in a variable called "$tier". It may look something like this based on the XPath in the test:
>
> <option rate-increase="">
>  <option-num></option-num?
> </option>
>
> >2) the bug I am trying to fix ...
>
> Is there another <xsl:when> or an <xsl:otherwise> elements in the <xsl:choose> ?
> --
> Charles Knell
> cknell@xxxxxxxxxx - email
>
>
>
> -----Original Message-----
> From:     Oleg Konovalov <olegkon@xxxxxxxxx>
> Sent:     Wed, 13 Dec 2006 14:07:13 -0500
> To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:   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

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.