I'm somewhat new to XSLT, so please forgive my ignorance.
My issue is similar, but the concat suggestion isn't working for me. I have an XML file with links to other XML files that contain snippets of content. I'm trying to insert those content snippets into the parent XML file where the link references occur. I created a variable that captures the link reference (if one exists) using this code:
Code:
<xsl:variable name="snippetpath">
<xsl:choose>
<xsl:when test="contains(item[@name='ContentSection']/value,'Snippet')" >
<xsl:value-of select="item[@name='ContentSection']/value/p/snippet/@dcrpath"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="item[@name='ContentSection']/value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
I know it's capturing the correct information because I can see the links using this code:
Code:
<xsl:value-of select="$snippetpath"/>
When I pass the $snippetpath variable to the document function using this code:
Code:
<xsl:value-of disable-output-escaping="yes" select="document('$snippetpath')//Properties/Data/Datum[@ID='D02']/DCR[@Type='ContentSnippet']/record/item[@name='ContentArea']/value/item[@name='ContentSubSection']/value/item[@name='ContentSection']/value"/>
I get a message that the resource cannot be found. But, if I hard code the path into the document function, it works:
Code:
<xsl:value-of disable-output-escaping="yes" select="document('../SNIP/SPSx10879')//Properties/Data/Datum[@ID='D02']/DCR[@Type='ContentSnippet']/record/item[@name='ContentArea']/value/item[@name='ContentSubSection']/value/item[@name='ContentSection']/value"/>
I can't figure out what I'm doing wrong. Any suggestions are greatly appreciated!