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

RE: Arrays in XSLT for variables?

Subject: RE: Arrays in XSLT for variables?
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 09:24:29 -0000
xslt variable arrays
> Maulik Modi wrote
> My XML doc1 (called BER2.xml in the stylesheet) is:
>
> <Node_path>//DATA/PARAMETERS/PARAMETER/TimeSheet/EmpUserID</Node_path>
>       <Node_value>txtester</Node_value>
>
> <Node_path>//DATA/PARAMETERS/PARAMETER/TimeSheet/BeginWeek</Node_path>
>       <Node_value>11/14/01</Node_value>
>
>
> Snippet XSL code:
>
>          <xsl:variable name="nvalue"
> select="following-sibling::Node_value"/>

In your source XML, the first <Node-path> element (despite its indentation)
has two following-sibling <Node_value> elements, so you are selecting them
both. I suspect you only want the immediate following sibling, i.e.

 <xsl:variable name="nvalue"
  select="following-sibling::Node_value[1]"/>

Better would be to add a containing element to reflect the hierarchic
structure more accurately; showing it by indentation isn't very useful when
it comes to processing it.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.