D
Daniel Frey
Hello,
I've got a problem. Either I have missed the most important point or
it really does not work:
I want to use the document function with an absolut path on WindowsXP
Professional and Saxon 8.1. However, retrieving a subnode of the
documents content is not possible. Inserting a whole document result
set is functional, subset not. Example:
001 <?xml version="1.0"?>
002 <xsl:stylesheet version="1.1"
003 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
004 <xsl
aram name="files" select="''"/>
005 <xsl:template match="/">
006 <Service>
007 <xsl:call-template name="concatenateFiles">
008 <xsl:with-param name="theFiles"
009 select="concat(normalize-space($files), ' ')"/>
010 </xsl:call-template>
011 </Service>
012 </xsl:template>
013
014 <xsl:template name="concatenateFiles">
015 <xsl
aram name="theFiles"/>
016 <xsl:variable name="file"
017 select="substring-before($theFiles, ' ')"/>
018 <xsl:copy-of select="document($file)/Service/Output"/>
019 <xsl:variable name="rest"
020 select="substring-after($theFiles, ' ')"/>
021 <xsl:if test="$rest">
022 <xsl:call-template name="concatenateFiles">
023 <xsl:with-param name="theFiles" select="$rest"/>
024 </xsl:call-template>
025 </xsl:if>
026 </xsl:template>
027 </xsl:stylesheet>
Passing an existing file to the "files" parameter does not work at
all. A simple <Service/> is returned. Reducing line 021 to
018 <xsl:copy-of select="document($file)"/>
does work, however doesn't achive the desired result to incorporate
just a subnode of the document loaded.
I am thankful for any hints in this concern.
Daniel Frey
I've got a problem. Either I have missed the most important point or
it really does not work:
I want to use the document function with an absolut path on WindowsXP
Professional and Saxon 8.1. However, retrieving a subnode of the
documents content is not possible. Inserting a whole document result
set is functional, subset not. Example:
001 <?xml version="1.0"?>
002 <xsl:stylesheet version="1.1"
003 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
004 <xsl
005 <xsl:template match="/">
006 <Service>
007 <xsl:call-template name="concatenateFiles">
008 <xsl:with-param name="theFiles"
009 select="concat(normalize-space($files), ' ')"/>
010 </xsl:call-template>
011 </Service>
012 </xsl:template>
013
014 <xsl:template name="concatenateFiles">
015 <xsl
016 <xsl:variable name="file"
017 select="substring-before($theFiles, ' ')"/>
018 <xsl:copy-of select="document($file)/Service/Output"/>
019 <xsl:variable name="rest"
020 select="substring-after($theFiles, ' ')"/>
021 <xsl:if test="$rest">
022 <xsl:call-template name="concatenateFiles">
023 <xsl:with-param name="theFiles" select="$rest"/>
024 </xsl:call-template>
025 </xsl:if>
026 </xsl:template>
027 </xsl:stylesheet>
Passing an existing file to the "files" parameter does not work at
all. A simple <Service/> is returned. Reducing line 021 to
018 <xsl:copy-of select="document($file)"/>
does work, however doesn't achive the desired result to incorporate
just a subnode of the document loaded.
I am thankful for any hints in this concern.
Daniel Frey