RE: [xsl] Arrays in XSLT for variables?

Subject: RE: [xsl] Arrays in XSLT for variables?
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 09:24:29 -0000
> 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"

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:

Current Thread