Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Keyword xsl:output may not be used here.

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I could add some hyperlinks with ids so that in same page I can nevigate..
But it is not working..
****************
<A href="#{@id}-DESCRIPTION" name="{@id}-COST">
<xsl:value-of select="name"/>
</A>
****************
in the above code snippet I could not get the value of {@id}???
and when I add xsl utput tag then it raised the following error
"Keyword xsl utput may not be used here. " what might be the reasong...
Thanks in advance
Saradhi....

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns="http://www.w3.org/TR/REC-html40" result-ns="">
<xsl utput method="html" version="4.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match = "/">
<html>
<body>
<h2> Juicers Example </h2>
<table border="1">
<tr>
<td>Jucers</td>
<td>Cost</td>
</tr>
<xsl:for-each select="/juicers/juicer">
<tr>
<td>
<A href="#{@id}-DESCRIPTION" name="{@id}-COST">
<xsl:value-of select="name"/>
</A>
</td>
<td>

$ <xsl:value-of select="cost[@currency='USD']"/>
</td>
</tr>
</xsl:for-each>

</table>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<table border="1" width="100%">
<tr>
<td>Jucers</td>
<td>Description</td>
</tr>
<xsl:for-each select="/juicers/juicer">
<tr>
<td>
<a href="#{@id}-COST" name="{@id}-DESCRIPTION">
<xsl:value-of select="name"/>
</a>
</td>
<td>
<xsl:value-of select="description"/>
</td>
</tr>
</xsl:for-each>
</table>


</body>
</html>
</xsl:template>
</xsl:stylesheet>
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only reason for complaining about <xsl:output> in that particular place is that the WD-xsl namespace you're using does not support it.
Once you change your <xsl:stylesheet> element to look like this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
it should work just fine.
 
This is my favorite show. And this is my favorite tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic