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

xsl stylesheet, assembly reference issue

PL

According to the documentation I'm supposed to be able to use any classes in the
..NET framework inside a msxml:script block if I use a fully qualified path.

I'm trying to test the XSL sheet below with ASP.NET and all I'm
getting is:

error CS0234: The type or namespace name 'Data' does not exist in
the class or namespace 'System' (are you missing an assembly reference?)

Could someone explain how you reference these classes from inside a msxml:script
block, I cannot find anything but really simple examples that do not reference any other
classes than the default.

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="http://mycompany.com/mynamespace"
version="1.0">

<!-- For this example use the book.xml example -->
<msxsl:script language="C#" implements-prefix="user">
<![CDATA[

string execSQL(string sql)
{
try{
System.Data.SqlClient.SqlConnection objconn = new System.Data.SqlClient.SqlConnection("connection-string-here");

objconn.Open();

System.Data.SqlClient.SqlCommand objcommand = new System.Data.SqlClient.SqlCommand(sql,objconn);

return((string)objcommand.ExecuteScalar());
}
catch(System.Exception ee)
{
return(ee.ToString());
}
finally
{
objconn.Close();
}
}
]]>
</msxsl:script>

<xsl:template match="/">
<xsl:value-of select="user:execSQL('SELECT TOP 1 Name FROM Table1')"/>
</xsl:template>
</xsl:stylesheet>
Nov 18 '05 #1
2 2001
to implement this you will need to use XSLT extension objects.
"PL" <pb****@yahoo.se> wrote in message
news:eV*************@TK2MSFTNGP09.phx.gbl...

According to the documentation I'm supposed to be able to use any classes in the .NET framework inside a msxml:script block if I use a fully qualified path.
I'm trying to test the XSL sheet below with ASP.NET and all I'm
getting is:

error CS0234: The type or namespace name 'Data' does not exist in
the class or namespace 'System' (are you missing an assembly reference?)

Could someone explain how you reference these classes from inside a msxml:script block, I cannot find anything but really simple examples that do not reference any other classes than the default.

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="http://mycompany.com/mynamespace"
version="1.0">

<!-- For this example use the book.xml example -->
<msxsl:script language="C#" implements-prefix="user">
<![CDATA[

string execSQL(string sql)
{
try{
System.Data.SqlClient.SqlConnection objconn = new System.Data.SqlClient.SqlConnection("connection-string-here");
objconn.Open();

System.Data.SqlClient.SqlCommand objcommand = new System.Data.SqlClient.SqlCommand(sql,objconn);
return((string)objcommand.ExecuteScalar());
}
catch(System.Exception ee)
{
return(ee.ToString());
}
finally
{
objconn.Close();
}
}
]]>
</msxsl:script>

<xsl:template match="/">
<xsl:value-of select="user:execSQL('SELECT TOP 1 Name FROM Table1')"/> </xsl:template>
</xsl:stylesheet>

Nov 18 '05 #2
PL

"bruce barker" <no***********@safeco.com> wrote in message news:e6**************@TK2MSFTNGP12.phx.gbl...
to implement this you will need to use XSLT extension objects.


Ok, that's one way but this is supposed to work according to docs:

http://msdn.microsoft.com/library/de...sxslscript.asp

"The following table shows the namespaces that are supported by default. You can use classes outside the listed
namespaces. However, these classes must be fully qualified."

I'm just confused as to why it doesnt work, that must be a documentation
error then.

PL.
Nov 18 '05 #3

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

Similar topics

2
by: George Durzi | last post by:
I have a dll that I use in several projects, that I placed in the Global Assembly Cache. This dll is references in each of my projects. This Dll is referenced by a type= declaration in my...
3
by: jlea | last post by:
I'm receiving the error message shown below when I try to load an aspx file (C# web application) on our server. The web application works fine if I remove the reference to the dll so I know the...
11
by: Just Me | last post by:
I have a solution containing many usercontrol projects. When I wish to reference a usercontrol in another project I can select either the project or the assembly. Does it make a difference which...
2
by: john | last post by:
Maybe I haven't had that "a-ha" moment yet, but I think the new approach to web projects is a step in the wrong direction. My main beef is that control over the assembly generation process has...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
2
by: John Bailey | last post by:
I have checked around and could not find anything here that exactly matches my issue, which is odd since I have found numerous posts on this in other news groups. I have a ASP .Net 2.0 site that...
5
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
From the amount of articles about this one I’m sure this gets asked a lot, but I haven’t yet found a succinct article which explains what is required in its entirety. I work using Visual...
14
by: Monty | last post by:
Hello, I have created a solution which has both a web UI and a winform UI, the latter is just for administrators. The Web UI (a Web Application Project) and the winform project both...
0
balabaster
by: balabaster | last post by:
Hi all, I'm creating a class factory and a bunch of adapters to allow in house applications to communicate with mobile applications over different cellular networks. I've got my class...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...

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.