473,323 Members | 1,551 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,323 software developers and data experts.

XsltArgumentList not working with ASP:XML control

Hi all.

This one is really getting to me now, I'm using the <asp:xml web server
control and I'm trying to use the XsltArgument list to add a custom class so
that I can do some formatting in the XSL style sheet. however each time it
complains that the prefix "util" could not be found, any ideas????????
bloody thing is driving me mad

code snippet:

Dim xslArg As Xml.Xsl.XsltArgumentList = New Xml.Xsl.XsltArgumentList
Dim util As Object = New test1
xslArg.AddExtensionObject("urn:util", util)
xmlGridData.DocumentContent = ds.GetXml
xmlGridData.TransformArgumentList = xslArg
xmlGridData.TransformSource = "paul.xsl"

XSL snippet:

<xsl:value-of select="util:sayhelloall"/>

Server error:

Prefix 'util' is not defined.
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: Prefix 'util' is not
defined.

Source Error:


Nov 12 '05 #1
4 4772
Paul wrote:
Dim xslArg As Xml.Xsl.XsltArgumentList = New Xml.Xsl.XsltArgumentList
Dim util As Object = New test1
xslArg.AddExtensionObject("urn:util", util)
xmlGridData.DocumentContent = ds.GetXml
xmlGridData.TransformArgumentList = xslArg
xmlGridData.TransformSource = "paul.xsl"

XSL snippet:

<xsl:value-of select="util:sayhelloall"/>


As you are talking about extension function, most likely you mean

<xsl:value-of select="util:sayhelloall()"/>

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2
Hi.

Tried that and it still fails.

Transscript from ASP.NET posting

At 12/6/2004 3:46:03 AM a message was posted to a thread you were tracking.

--------------------------

Re: XsltArgumentList not working with ASP:XML control by madladuk If I add
this to the xsl sheet when i call the function whch basically returns a
string nothing is shown in the html.

<xsl:stylesheet

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:user="urn:my-scripts"

xmlns:msxsl="urn:schemas-microsoft-com:xslt"

xmlns:dt="urn:schemas-microsoft-com:datatypes"

xmlns:util="urn:util"

version="1.0">

If I call the funciton as util:sayhelloall then nothing is shown and no
error is produced. When I use the debugger the function is never called. If
i use sayhelloall() then the following error is received.

Server Error in '/inSight_200' Application.

--------------------------------------------------------------------------------

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

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 'util'.

Source Error:

[XsltException: Cannot find the script or external object that implements
prefix 'util'.]

System.Xml.Xsl.XsltCompileContext.ResolveFunction( String prefix, String
name, XPathResultType[] argTypes) +283

System.Xml.XPath.XsltFunction.get_Function() +126

System.Xml.XPath.XsltFunction.ReturnType() +11

System.Xml.XPath.XPathNavigator.Evaluate(XPathExpr ession expr,
XPathNodeIterator context) +70

System.Xml.Xsl.Processor.ValueOf(ActionFrame context, Int32 key) +52

System.Xml.Xsl.ValueOfAction.Execute(Processor processor, ActionFrame frame)
+54

System.Xml.Xsl.ActionFrame.Execute(Processor processor) +24

System.Xml.Xsl.Processor.Execute() +78

System.Xml.Xsl.XslTransform.Transform(IXPathNaviga ble input,
XsltArgumentList args, TextWriter output, XmlResolver resolver) +74

System.Web.UI.WebControls.Xml.Render(HtmlTextWrite r output) +155

System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241

System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72

System.Web.UI.Control.Render(HtmlTextWriter writer) +7

System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241

System.Web.UI.Page.ProcessRequestMain() +1880

--------------------------

To view the complete thread and reply, please visit:

http://www.asp.net/Forums/ShowPost.a...&PostID=764762

You were sent this email because you opted to receive email notifications
when someone responded to this thread. To unsubscribe to this thread either:

1. Visit the above URL and uncheck 'Email me when someone replies...'

2. Visit your user profile page and uncheck 'Enable email tracking'

Thanks,

ASP.NET Forums Moderation Team

Note, moderation is provided by the ASP.NET developer community. Microsoft
is not responsible for, shall have no liability for and disclaims all
warranties whatsoever, expressed or implied.


"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:Oe**************@tk2msftngp13.phx.gbl...
Paul wrote:
Dim xslArg As Xml.Xsl.XsltArgumentList = New Xml.Xsl.XsltArgumentList
Dim util As Object = New test1
xslArg.AddExtensionObject("urn:util", util)
xmlGridData.DocumentContent = ds.GetXml
xmlGridData.TransformArgumentList = xslArg
xmlGridData.TransformSource = "paul.xsl"

XSL snippet:

<xsl:value-of select="util:sayhelloall"/>


As you are talking about extension function, most likely you mean

<xsl:value-of select="util:sayhelloall()"/>

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com

Nov 12 '05 #3
Paul wrote:
If I call the funciton as util:sayhelloall then nothing is shown and no
error is produced. When I use the debugger the function is never called. If
i use sayhelloall() then the following error is received.
util:sayhelloall isn't a function call. As per XPath syntax that selects
an element named util:sayhelloall. Functions always have round brackets
at the end.
Cannot find the script or external object that implements prefix 'util'.

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 'util'.


Dim xslArg As Xml.Xsl.XsltArgumentList = New Xml.Xsl.XsltArgumentList
Dim util As Object = New test1

Hey, you pass it as Object, why? I'm not sure but that might be the
reason. Pass it as an instance of test1 class. And make sure test1 class
has public non-static method named "sayhelloall" with no arguments.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #4
Excellent, thanks that worked, also found that the class name was not
correct.
Thanks
Paul
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:O5*************@TK2MSFTNGP14.phx.gbl...
Paul wrote:
If I call the funciton as util:sayhelloall then nothing is shown and no
error is produced. When I use the debugger the function is never called.
If i use sayhelloall() then the following error is received.


util:sayhelloall isn't a function call. As per XPath syntax that selects
an element named util:sayhelloall. Functions always have round brackets at
the end.
Cannot find the script or external object that implements prefix 'util'.

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 'util'.


Dim xslArg As Xml.Xsl.XsltArgumentList = New Xml.Xsl.XsltArgumentList
Dim util As Object = New test1

Hey, you pass it as Object, why? I'm not sure but that might be the
reason. Pass it as an instance of test1 class. And make sure test1 class
has public non-static method named "sayhelloall" with no arguments.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Grant Harmeyer | last post by:
I am attempting to construct a simple ASP.NET Rss/Xml newsfeed. If anyone has visited Don Box's Blog (http://www.gotdotnet.com/team/dbox/), you will notice that his Rss feed is exposed through an...
1
by: Greg Collins [MVP] | last post by:
I've got a web site I've built that uses an InfoPath form to generate an xml file. This file is then transformed within the default.aspx page to create the contents of the page. The problem I'm...
0
by: Random | last post by:
I would like to be able to read an Xml file with an <asp:Xml> Web Control and using XSLT dynamically write <asp:Xml> Web Controls to the page using the information from the first Xml file, which...
1
by: Danny Ni | last post by:
Hi, I use the <asp:xml> control, xml and xslt to generate a HTML for users to input data, here is my HTML snippet in a web form: <asp:Xml id="Xml1" runat="server" TransformSource="entry.xsl"...
1
by: Monster | last post by:
When <asp:xml is included in the aspx page, the source page contains this line "<?xml version="1.0" encoding="utf-8"?>" which shouldn't be in the html file.
0
by: msnews.microsoft.com | last post by:
Hello I am using ASP:XML with a web control... which in turns pulls XML from SQL server and later does the transformation... /***/ this.l__obj__XML.Document = // XML result set from SQL...
0
by: mareal | last post by:
I am using the ASP:XML control to format XML data into HTML (thru XSLT). This works great so far. During the transformation, I am creating a table with links (<a>). I need to give these links a...
0
by: Will Chamberlain | last post by:
Before I start let me clarify that an XmlDataSource will not work for what I am doing. I am attempting to recreate a .NET version of binding Xml Data Islands to HTML Tables in IE 5.x+. You could...
1
by: mweb72 | last post by:
Hi all, I have a strong problem in asp/xml, i think it's a little thing but hard to find... Then, i get an xml file, it contain 3 childsnodes as product, and many items into. But, i can't ready...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.