This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Arrays in XSLT for variables?


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]