|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] linking in XML
Hi !
If I want to link from one XML-file to another (using IE5.5 + MSXML2)
including anchors I tried the following:
file1:
<?xml ...>
<section id="test1" linkto="file2.xml#test2">
any text
</section>
file2:
<?xml ...>
<section id="test2">
text linked to
</section>
with the following xsl-script I translate both into a <a>-tag
(using attribs href="file2.xml#test2" for file1 and name="test2" for
file2):
<xsl:stylesheet>
...
<xsl:template match="section">
<div class="section">
<xsl:if test=".[@id]">
<!-- this should create the anchor to link to -->
<a>
<xsl:attribute name="name">
<xsl:value-of select="@id"/>
</xsl:attribute>
</a>
</xsl:if>
<xsl:if test=".[@linkto]">
<a>
<xsl:attribute name="href">
<xsl:value-of select="@linkto"/>
</xsl:attribute>
link to <xsl:value-of select="@linkto"/>
</a>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
...
The result is not what I exspected: the link will display the xml-file
(the URL-line will
also dispolay the anchor: "../file2.xml#test2" , but will not jump to
the corresponding anchor #test2
can somebody help me ?
Thanks
Knut
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








