473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cannot find the script or external object that implements prefix 'counter'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.Xsl.XsltException: Cannot find the script or external object that implements prefix 'counter'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


I am using XSLT transformation to display XML file in ASP.NET 2.0 and to pass the value inbetween the page i am using javascript.Any help is appreciated.
My XSLT code is:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan"
  3.  xmlns:lxslt="http://xml.apache.org/xslt" xmlns:counter="ext1"  extension-element-prefixes="counter">
  4.  
  5.   <xsl:output method="html" version="1.0" encoding="utf-8" indent="yes"/>
  6.   <lxslt:component prefix="counter" functions="count">
  7.     <lxslt:script lang="Javascript">
  8.       var i = 1;
  9.       function count()
  10.       {
  11.       i=i+1;
  12.       return i;
  13.       }
  14.     </lxslt:script>
  15.   </lxslt:component>
  16.   <xsl:template match="/">
  17.     <html>
  18.       <head>
  19.  
  20.       </head>
  21.       <body>
  22.        <xsl:value-of select="counter:count()" />
  23.        <!--<xsl:apply-templates/>-->
  24.      </body>
  25.   </html>
  26.   </xsl:template>
  27.  
  28.  
  29.  
  30.   <xsl:template name="tar" match="TARGETCATEGORY">
  31.       <table border="2" BorderColor="#DEBA84" height="50px"  Width="436px" layout="fixed">
  32.       <tr><td colspan="2">
  33.          <a href="#{@Name}"><xsl:value-of select="@Name"/></a>   
  34.       </td></tr>
  35.     </table>
  36.     <xsl:variable name="node1" select="@Name"></xsl:variable>
  37.        <xsl:apply-templates/>
  38.  </xsl:template>
  39.  
  40.  
  41.  
  42.  
  43.  
  44.   <xsl:template match="SUBCATEGORY">
  45.     <xsl:value-of select="counter:count()" />
  46.  
  47.     <table border="2" BorderColor="#DEBA84" Width="436px" layout="fixed">
  48.          <tr><td colspan="2">
  49.               <a href="#{@Name}"><xsl:value-of select="@Name"/></a>
  50.              <a name="Top"></a>
  51.           </td></tr>
  52.     </table>
  53.       </xsl:template>
  54.    </xsl:stylesheet> 
Thanks in advance.


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Feb 18 '08 #1
3 7838
kenobewan
4,871 Expert 4TB
This article may help:
XSLT - On the Client
Feb 18 '08 #2
This article may help:
XSLT - On the Client
hi
i am still unable to remove that error.
Actually i want to retrive that return value of javascript funtion in my Template present in the same file.

thanks
Feb 19 '08 #3
This article may help:
XSLT - On the Client

I am using XSLT transformation to display XML file in ASP.NET 2.0 and I want to make A table of content similar as in the page of following link given .
....LINK....


My Code of xslt page is :

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
  4.   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  5.  
  6.   <xsl:template match="/">
  7.     <html>
  8.  
  9.     <body>
  10.  
  11.       <xsl:apply-templates/>
  12.     </body>
  13.   </html>
  14. </xsl:template>
  15.  
  16. <xsl:template match="TARGETCATEGORY">
  17.       <table border="2" BorderColor="#DEBA84" height="50px"  Width="436px" layout="fixed">
  18.       <tr><td colspan="2">
  19.          <a href="#{@Name}"><xsl:value-of select="@Name"/></a>
  20.           <xsl:variable name="node1">
  21.           <xsl:value-of select="@Name"/>
  22.           </xsl:variable>    
  23.       </td></tr>
  24.     </table>
  25.        <xsl:apply-templates/>
  26.  </xsl:template>
  27.  
  28. <xsl:template name="sub" match="SUBCATEGORY">
  29. <table border="2" BorderColor="#DEBA84" Width="436px" layout="fixed">
  30.          <tr><td colspan="2">
  31.               <a href="@Name" onClick="count(i=i+1); return;"><xsl:value-of select="@Name"/></a>
  32.              <a name="Top"></a>
  33.           </td></tr>
  34.     </table>
  35.  
  36.       </xsl:template>
  37.    </xsl:stylesheet> 


I want to assign a number to each anchor tag dynamically.

Please help me.......!!!!!!!!!!!!!!!!!!!!
thanks in advance.
Feb 20 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork =...
4
by: nc | last post by:
My iterator can find my collection when my Action class calls my jsp directly, however when my Action class calls an html file that is set up with IFrames (one of which is loading that same jsp), I...
1
by: Gene Goykhman | last post by:
Hi there. Has anyone experienced an intermittent problem where only functions from the first included script tag are available to the onLoad event handler? An example: <html> <head> <script...
3
by: cjl | last post by:
Hey all: Just getting my feet wet with javascript. The following script works fine in Firefox, but won't run in IE. In fact, I've included this script as an external file in the <head> of my...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
2
by: anson | last post by:
this code is an example code of TPOP, i type them and can be compiled... but when give some input , it getting segment fault .... i observed that when the build() initial the word table ... it...
1
by: dragze | last post by:
Hi, On one of the pages of my site i use two javascripts, one makes transparency of png's work in IE, and the other embeds a flash player. Now use one of the scripts it works fine, use both and...
7
by: =?Utf-8?B?Um9iIFRob21zb24=?= | last post by:
Hi is there a way in asp.net 1.1 to in code behind query the page size that is generated, I realise IIS does it as it has that data in the logs, I would like to capture this data so that I can...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.