I need help where I can store two xslt variables in 1 array like variable to be used later
<xsl:variable name="edgeDeviceArray">
<Item><xsl:value-of select="$edgeDev1" /></Item>
<Item><xsl:value-of select="$edgeDev2" /></Item>
</xsl:variable>
But the output of the above seems to be concatenation. I would like to refer later like edgeDeviceArray[1]...
Here is a (non-working) fragment of my stylesheet demonstrating what I am trying to do
<xsl:variable name="edgeDev1"
select="$deviceDoc/x:config/t:devices/t:device[t:address=$edgeDev1IP]/t:name" />
<xsl:variable name="edgeDev2"
select="$deviceDoc/x:config/t:devices/t:device[t:address=$edgeDev2IP]/t:name" />
<xsl:variable name="xrSet" select="$xrDeviceDoc/x:config/t:devices/t:device-module/t:devices" />
<xsl:for-each select="$xrSet">
<xsl:variable name="asideDoc"
select="document(concat($edgeDevice[position()], '.xml'))" />
</xsl:for-each>
Here, I am reading the devices names from 1 doc based on certain attributes if they match.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:t="http://tail-f.com/ns/ncs"
xmlns:x="http://tail-f.com/ns/config/1.0"
xmlns:y="http://tail-f.com/ned/alu-sr"
xmlns:a="http://tail-f.com/ned/cisco-ios-xr"
xmlns:m="http://mask.data"
xmlns:im="http://inverse-mask.data" exclude-result-prefixes="xsl t x y"
xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:variable name="deviceDoc" select="document('devices.xml')" />
<xsl:variable name="edgeDev1IP"
select="../y:sdp[y:sdp-id=$sdpSet[1]]/y:far-end" />
<xsl:variable name="edgeDev1"
select="$deviceDoc/x:config/t:devices/t:device[t:address=$edgeDev1IP]/t:name" />
<xsl:variable name="edgeDev2IP"
select="../y:sdp[y:sdp-id=$sdpSet[2]]/y:far-end" />
<xsl:variable name="edgeDev2"
select="$deviceDoc/x:config/t:devices/t:device[t:address=$edgeDev2IP]/t:name" />
<xsl:variable name="xrDeviceDoc" select="document('xrDevices.xml')" />
<xsl:variable name="xrSet"
select="$xrDeviceDoc/x:config/t:devices/t:device-module/t:devices" />
<xsl:variable name="edgeDeviceArray">
<item><xsl:value-of select="$edgeDev1" /></item>
<item><xsl:value-of select="$edgeDev2" /></item>
</xsl:variable>
<anurag><xsl:value-of select="exsl:node-set($edgeDeviceArray)/item[1]" /></anurag>
</xsl:template>
</xsl:stylesheet>