473,657 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XsltArgumentLis t 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.XsltArg umentList = New Xml.Xsl.XsltArg umentList
Dim util As Object = New test1
xslArg.AddExten sionObject("urn :util", util)
xmlGridData.Doc umentContent = ds.GetXml
xmlGridData.Tra nsformArgumentL ist = xslArg
xmlGridData.Tra nsformSource = "paul.xsl"

XSL snippet:

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

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 4799
Paul wrote:
Dim xslArg As Xml.Xsl.XsltArg umentList = New Xml.Xsl.XsltArg umentList
Dim util As Object = New test1
xslArg.AddExten sionObject("urn :util", util)
xmlGridData.Doc umentContent = ds.GetXml
xmlGridData.Tra nsformArgumentL ist = xslArg
xmlGridData.Tra nsformSource = "paul.xsl"

XSL snippet:

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


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

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

--
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: XsltArgumentLis t 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:styleshe et

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

xmlns:user="urn :my-scripts"

xmlns:msxsl="ur n:schemas-microsoft-com:xslt"

xmlns:dt="urn:s chemas-microsoft-com:datatypes"

xmlns:util="urn :util"

version="1.0">

If I call the funciton as util:sayhelloal l 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. XsltCompileCont ext.ResolveFunc tion(String prefix, String
name, XPathResultType[] argTypes) +283

System.Xml.XPat h.XsltFunction. get_Function() +126

System.Xml.XPat h.XsltFunction. ReturnType() +11

System.Xml.XPat h.XPathNavigato r.Evaluate(XPat hExpression expr,
XPathNodeIterat or context) +70

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

System.Xml.Xsl. ValueOfAction.E xecute(Processo r processor, ActionFrame frame)
+54

System.Xml.Xsl. ActionFrame.Exe cute(Processor processor) +24

System.Xml.Xsl. Processor.Execu te() +78

System.Xml.Xsl. XslTransform.Tr ansform(IXPathN avigable input,
XsltArgumentLis t args, TextWriter output, XmlResolver resolver) +74

System.Web.UI.W ebControls.Xml. Render(HtmlText Writer output) +155

System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +241

System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +72

System.Web.UI.C ontrol.Render(H tmlTextWriter writer) +7

System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +241

System.Web.UI.P age.ProcessRequ estMain() +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!P LEASEtkachenko. com> wrote in message
news:Oe******** ******@tk2msftn gp13.phx.gbl...
Paul wrote:
Dim xslArg As Xml.Xsl.XsltArg umentList = New Xml.Xsl.XsltArg umentList
Dim util As Object = New test1
xslArg.AddExten sionObject("urn :util", util)
xmlGridData.Doc umentContent = ds.GetXml
xmlGridData.Tra nsformArgumentL ist = xslArg
xmlGridData.Tra nsformSource = "paul.xsl"

XSL snippet:

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


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

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

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

Nov 12 '05 #3
Paul wrote:
If I call the funciton as util:sayhelloal l 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:sayhelloal l isn't a function call. As per XPath syntax that selects
an element named util:sayhelloal l. 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.XsltArg umentList = New Xml.Xsl.XsltArg umentList
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 "sayhelloal l" 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!P LEASEtkachenko. com> wrote in message
news:O5******** *****@TK2MSFTNG P14.phx.gbl...
Paul wrote:
If I call the funciton as util:sayhelloal l 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:sayhelloal l isn't a function call. As per XPath syntax that selects
an element named util:sayhelloal l. 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.XsltArg umentList = New Xml.Xsl.XsltArg umentList
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 "sayhelloal l" 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
1500
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 ASP.NET page. When you load the .aspx page in IE, it displays just as an Xml doc would (colored nodes, expandable node heirarchy, etc.). I would like to mimic this using the <asp:Xml /> server control and pumping the Xml to it from a CodeBehind...
1
1295
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 running into is that I need to be able to return more ASP.NET code as part of the return value of the <asp:Xml/> call, but it does not get processed at this point. The call: <asp:Xml id="myXml" runat="server" DocumentSource="myFile.xml"...
0
1197
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 would in turn perform their own transform based on existing xml and xslt files. As another way of accomplishing my goal, I was thinking I could have a dataset tied to a repeater or table control that would write out the <asp:Xml> controls for...
1
1219
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" DocumentSource="data.xml"></asp:Xml> The form display correctly in the browser, the question is, how do I get the values users input?
1
1122
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
904
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 server - String this.l__obj__XML.Transform = //XSLT - pointer a file on a local drive
0
941
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 unique ID and I can't find a way to do this. Any ideas? Finally, I need to be able to debug the HTML output from the ASP:XML control. Every time I do View->Source, I am able to see the HTML code for the page and NOT the ASP:XML control. What do...
0
1127
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 easily use an Xml File as DSO and bind to an HTML table, easy. The reason an XmlDataSource doesn't work is because the Xml file isn't downloaded to the client. For my program to work, I need that since I am doing drag and drop and appending...
1
1229
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 more than one childnodes, explanations : My code : Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0") objHTTP.open...
0
8823
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
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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
4151
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.