Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello! Got a problem chaps! I ha

Status
Not open for further replies.

trufla

Programmer
Aug 9, 2004
31
GB
Hello! Got a problem chaps!

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

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform
  xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] 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>
    
 <!-- A -->
        <xsl:apply-templates mode="toc"/>
        
       

      <!-- B -->
        <xsl:apply-templates/>    
    
   </card>
   </wml>   
   </xsl:template>
    
     
  <!-- C -->
  <xsl:template match="Article" mode="toc">
    <a href="#{ArticleTitle}"><xsl:value-of select="ArticleTitle"/></a><br/>
  </xsl:template>
  
<!-- D -->
  <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!
 
You may have made them in reverse between the mode and the one without mode for Article match. (Not 100% certain, though.) Try this.
[tt]
<!-- C -->
[red]<!-- without mode here -->[/red]
<xsl:template match="Article">
<a href="#{ArticleTitle}"><xsl:value-of select="ArticleTitle"/></a><br/>
[blue]<!-- add in the apply-templates element -->[/blue]
[blue]<xsl:apply-templates/>[/blue]
</xsl:template>
<!-- D -->
[red]<!-- with mode here -->[/red]
<xsl:template match="Article" [blue]mode="toc"[/blue]>
<div>
<h2><a name="{ArticleTitle}"><xsl:value-of select="ArticleTitle"/></a></h2>
[blue]<!-- taken out the apply-templates element -->[/blue]
</div>
</xsl:template>
[/tt]
 
I have forgotten to move the stylistic tag <h2> too. But, you get the idea.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top