Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 15th, 2006, 06:32 PM
Authorized User
 
Join Date: May 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Navigating table of content in XSL

I have this code to create a wap site from one card.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">



 <xsl:template match="/">

<wml>

  <card id="Stories" title="Dingley Dell News">
        <p>
      <big><b>News Stories</b></big>
    </p>
<p><img src="mobileImages/phone.wbmp" alt="mobile phone" /></p>
<p><a href="index.html">home</a></p>

 
        <xsl:apply-templates mode="toc"/>




        <xsl:apply-templates/>    

   </card>
   </wml>   
   </xsl:template>



  <xsl:template match="Article" mode="toc">
    <a href="#{ArticleTitle}"><xsl:value-of select="ArticleTitle"/></a><br/>
  </xsl:template>


  <xsl:template match="Article">
    <div>
      <h2><a name="{ArticleTitle}"><xsl:value-of select="ArticleTitle"/></a></h2>
      <xsl:apply-templates/>
    </div>
  </xsl:template>


  <xsl:template match="ArticleTitle"/>

 <xsl:template match="ArticleEntry">
<p><a href="TransXML_Mobile.php">back to story links</a></p>
    <p><xsl:apply-templates/></p>
  </xsl:template>

</xsl:transform>
The problem is that I want to be able to click the link "back to story links" to go back to the top of the card.

But when I navigate to a story, if I want to return to the top of the card, I should be able to click the link "back to story links", but it cannot be highlighted and clicked.

Anyone have any ideas how to solve this?


Cheers!



 
Old May 16th, 2006, 03:24 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I think it's always a good idea to split these problems into two. First work out what HTML you want to generate, then work out what XSLT is needed to produce it. From your description of the problem, it's not clear whether you know what HTML you are trying to generate or not. Don't start to tackle the XSLT coding until you know what its output (that is, the HTML) should be.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 16th, 2006, 10:08 AM
Authorized User
 
Join Date: May 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hiya!

I just wanted to produce this:

Code:
<wml>

  <card id="Stories" title="The title">
  <p>News Stories</p>
 

  <p>Table of contents - <a href="#Story1">link 1</a></p>
  <p>Table of contents - <a href="#Story2">link 2</a></p>
  <p>Table of contents - and so on</p>

  <p id="Story1">Story Content</p>
  <a href="#Stories">back to top</a>

   </card>
   </wml>
But when I jump to say link 20 the 'back to top' link does not hightlight.

Cannot you not use anchors in one card?






Similar Threads
Thread Thread Starter Forum Replies Last Post
very urgent:cals table to indesign table using xsl franklinclinton XSLT 1 December 16th, 2009 03:48 PM
How to dynamic display the content of the table? myhrvod Pro Java 0 August 3rd, 2006 12:42 AM
how i can save my file content into a table chandanbhakuni Classic ASP Professional 0 July 14th, 2006 07:23 AM
constructing node-set content to xsl:variable MrWay XSLT 3 February 28th, 2006 10:39 AM
Dynamically Changing the content of a table cell asdasd Javascript 4 February 18th, 2005 01:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.