This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Arrays in XSLT for variables?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Arrays in XSLT for variables?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Tue, 20 Feb 2001 09:24:29 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> 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