473,756 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

11 New Member
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.507 27.42; ASP.NET Version:2.0.507 27.42
Feb 18 '08 #1
3 7886
kenobewan
4,871 Recognized Expert Specialist
This article may help:
XSLT - On the Client
Feb 18 '08 #2
Abhinavnaresh
11 New Member
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
Abhinavnaresh
11 New Member
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
50587
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 = WScript.CreateObject("WScript.Network") sPwd = inputbox("Enter password") WshNetwork.MapNetworkDrive "J:", "\\server1\data", false, "xyz_net\John", sPwd Msgbox "Drives has been map successful"
4
10306
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 get a servlet error "cannot find collection". Not usre if my issue is HTML, JSP, WebSphere or ??? Any help is very much appreciated. HTML file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
1
2449
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 src="library1.js></script> <script src="library2.js></script> <script> function doLoad()
3
1760
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 html file, and the remainder of the page doesn't load at all in IE. If I remove the <script>, the page loads in IE. var images = new Array(); var firstImage = 2;
10
4468
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 Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering the table definitions, all of which seems to work OK, I entered a tiny 8-row table and can do...
2
1776
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 invoke next_word(in the book its name is new() )and invoke the routine lookup ...but it cannot lookup anything ....and return NULL. where goes wrong? below is the code...
1
2725
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 the transparency script stops working. So for example, use just the png transparency script and it displays the png's correctly in IE, as soon as i add the SWFobject (flash embedding) script the transparency script stops working!!?? :S Any help...
7
4682
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 create a log for performance on our site that is all held in the database TIA
2
6658
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) Location: class Week5MortgageGUI Week5MortgageLogic allint = logic.allInterest(amount, term, rate); Week5MortgageGUI.java:152:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI
0
9431
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9255
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10014
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9689
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6514
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3780
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.