wood burning stoves*
The moose likes XML and Related Technologies and the fly likes Keyword xsl:output may not be used here. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Keyword xsl:output may not be used here. " Watch "Keyword xsl:output may not be used here. " New topic
Author

Keyword xsl:output may not be used here.

Pardha
Greenhorn

Joined: May 13, 2001
Posts: 15
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>


Intelligent Hard work never goes waste
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The only reason for complaining about <xslutput> 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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
Consider Paul's rocket mass heater.
 
subject: Keyword xsl:output may not be used here.