How to get rid of result-document href in generated a href?
Posted: Mon Dec 19, 2005 9:59 pm
Hello dears,
I'm quite new to Xslt and I'm trying to generate a complete html web site.Datas are enclosed in the XML file and I started by generating each /directory/page.htm one by one. Expecting something a little bit more "industrial" I googled and found two solutions : extensions with xslt 1.0 and the xslt2.0 result-document element. I was not able to set-up xslt1.0 with an appropriate extension in oxygen6.2 so I switched to xslt2.0 and the <xslt:result-document/> element, and Saxon8B.
The xslt file look like this :
And whatever I tried, for all <a/> generated elements, I can't control the <a href=""> attribute and get a {$vrepertoire} prefixe in every <a/> generated element.
I guess this is a known issue, but could not find information on the subject.
http://www.w3.org/TR/xslt20/#terminology
Thank you for reading !
I'm quite new to Xslt and I'm trying to generate a complete html web site.Datas are enclosed in the XML file and I started by generating each /directory/page.htm one by one. Expecting something a little bit more "industrial" I googled and found two solutions : extensions with xslt 1.0 and the xslt2.0 result-document element. I was not able to set-up xslt1.0 with an appropriate extension in oxygen6.2 so I switched to xslt2.0 and the <xslt:result-document/> element, and Saxon8B.
The xslt file look like this :
Code: Select all
xsl:template match="/">
<xsl:for-each select=" //page | //page-rubr | //page-sous-rubr">
<xsl:variable name="vrepertoire" select="ancestor::chapitre/repertoire-chap"></xsl:variable>
<xsl:variable name="extension" select=" '.htm' "></xsl:variable>
<xsl:result-document href="{$vrepertoire}/{.}{$extension}" />
<!-- ....code code ... code content generating OK-->
<!-- sidebar generating for the current page .... -->
<xsl:for-each select="rubrique">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="page-rubr"/><xsl:text>.htm</xsl:text>
</xsl:attribute>
<xsl:value-of select="titre-rubr"/>
</a>
</li>
</xsl:for-each>
I guess this is a known issue, but could not find information on the subject.
http://www.w3.org/TR/xslt20/#terminology
Do you dears have any clue ?It will often be the case that one final result tree contains links to another final result tree produced during the same transformation, in the form of a relative URI. The mechanism of associating a URI with a final result tree has been chosen to allow the integrity of such links to be preserved when the trees are serialized.
Thank you for reading !