[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

linking in XML

Subject: linking in XML
From: Knut Alboldt <alboldt@xxxxxxx>
Date: Wed, 04 Oct 2000 12:30:59 +0200
linking in xml anchor
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.