Hello everybody,
I am looking for some hours for a solution. Should be very simple, but I can't find any hint. (Background: I am trying to build a DUL to HTML Transformation for diffxml. Maybe this is already done or anyone has a better idea to show xmldiffs...)
Problem: There is some pice of XSLT-code in one XML-file ('instructions.xml'), a source-file ('in.xml'), and the XSLT-Transformation ('test.xsl') working on the source-file. The Transformation should read instructions and use this as instructions for the transformation of in.xml. Instead I only can get the processor to read the instructions as text but not as instructions. (Maybe the code can better to be understood, than my English)
in.xml
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<node name="blabla"/>
</root>
data.xml
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<node name="blabla"/>
</root>
instructions.xml
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<inst code="//node/@name"/>
</root>
test.xsl
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="iso-8859-1" />
<xsl:template match="/">
<xsl:for-each select="collection('./?select=instructions.xml')/root/inst">
<xsl:variable name="code"><xsl:value-of select="@code" /></xsl:variable>
<xsl:value-of select="$code"/>
</xsl:for-each>
<xsl:value-of select="//node/@name" />
</xsl:template>
</xsl:stylesheet>
Any hints are really apreciated!
Best regards
Christian