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

Re: Can a single XPath statement duplicate the func

Subject: Re: Can a single XPath statement duplicate the functionality of this verbose <xsl:choose> statement?
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Sun, 23 Oct 2011 17:58:31 -0700
Re:  Can a single XPath statement  duplicate the   func
Hi Ken,
I removed the [1] at the end to get all of the returns, and for the second example a '50' is returned, the @denomination[5] and the default [0]. It is clear that the @souvenir-sheet value is ignored in both cases. I am using XSLT 2, so it always collapses. Is there something incorrect with


../Location[name(@*)=name(current()/@*)]

It seems correct to me.
Mark

-----Original Message----- From: Mark
Sent: Sunday, October 23, 2011 5:39 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Can a single XPath statement duplicate the functionality of this verbose statement?


Hi Ken,
Yes, only one attribute to either element.

You said:
xsl:copy-of select="( ../Location[name(@*)=name(current()/@*)] ,
                    ../Location/@denomination ,
                    '0' )[1]"/>

but I may have explained my needs incorrectly. Your statement works on the
first example below [uses @denomination] but returns nothing for the second
example; there it should return the value of the <Locations
@souvenir-sheet>, i.e., '1'.
Thanks,
Mark

<Stamp>
       <Formats souvenir-sheet="2895"/>
     <Location denomination="1"/>
</Stamp>

<Stamp>
      <Formats souvenir-sheet="2896"/>
     <Location denomination="5"/>
     <Location souvenir-sheet="1"/>
   </Stamp>

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.