473,832 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Migrating XSL stylsheets with msxsl:script from MSXML4 to System.X

Hello guys,

I am having problems trying to migrate our MSXML4-compatible stylesheets
containing large msxsl:script blocks to a formate understandable by
System.Xml:Xsl. XslTransform. I keep getting JS1135 errors saying that some
variable was not declared. This scripts worked perfectly with MSXML4. Is
there a guide for migraiton from MSXML to .NET or can you just give me some
tips on how to resolve this issues without having to change dozens of
working, already tested and deployaed XSLTs?

Regards,
Eugen Gulinsky
Nov 12 '05 #1
3 3645

Eugen Gulinsky wrote:
I am having problems trying to migrate our MSXML4-compatible stylesheets
containing large msxsl:script blocks to a formate understandable by
System.Xml:Xsl. XslTransform. I keep getting JS1135 errors saying that some
variable was not declared. This scripts worked perfectly with MSXML4. Is
there a guide for migraiton from MSXML to .NET or can you just give me some
tips on how to resolve this issues without having to change dozens of
working, already tested and deployaed XSLTs?


Scripting is an extension to XSLT, don't expect that to be portable.
MSXML uses the Active Script engines for JScript or VBScript, .NET while
calling it msxsl:script uses one of the .NET languages and compiles,
even if you use JScript.NET it is a completely different implementation
to the COM based JScript.
What is more important, the object model your "script" operates on when
XSLT/XPath passes in nodes (node sets) is completely different, with
MSXML it is the MSXML XML DOM but within .NET it is not DOM at all, how
the XSLT/XPath types translate into .NET types is documented here:
<http://msdn.microsoft. com/library/default.asp?url =/library/en-us/cpref/html/frlrfSystemXmlX slXslTransformC lassTopic.asp>

So you have
Node Set (XPath) as System.Xml.XPat h.XPathNodeIter ator
and
Result Tree Fragment (XSLT) as System.Xml.XPat h.XPathNavigato r
and need to use those APIs.
Note also that .NET 2.0 comes with a completely new XSLT implementation
though this document
<http://blogs.msdn.com/xmlteam/archive/2005/09/30/475922.aspx> claims
that migration from MSXML will be a bit easier as far as script is
concerned. But it also says
"In XslCompiledTran sform a binding (method name lookup) to script
functions happens at compile time, and stylesheets that are compliable
with XslTranform may throw an exception during compilation with
XslCompiledTran sform."
thus if you are now trying to move script in XSLT from MSXML to .NET
consider whether you do it in .NET 2.0 from the beginning.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
Hello Martin,

thanks for the fast reply. I also already realized there will be no easy
porting our stylesheets away from legacy MSXML. They make heavy use of the
IXSLProcessor.a dd_object method to set a custom functions library which is
then being used in the msxsl:script portions. What I will try to do now is to
use MSXML thru an interop assembly to instantiate the right COM objects like
stylesheet and XSLT processor. I will then provide the processor object with
an interop version of the custom functions library and hope the underlying
COM objects will work together ;-) I am of cource open for better suggestions.

Regards,
Eugen

"Martin Honnen" wrote:

Eugen Gulinsky wrote:
I am having problems trying to migrate our MSXML4-compatible stylesheets
containing large msxsl:script blocks to a formate understandable by
System.Xml:Xsl. XslTransform. I keep getting JS1135 errors saying that some
variable was not declared. This scripts worked perfectly with MSXML4. Is
there a guide for migraiton from MSXML to .NET or can you just give me some
tips on how to resolve this issues without having to change dozens of
working, already tested and deployaed XSLTs?


Scripting is an extension to XSLT, don't expect that to be portable.
MSXML uses the Active Script engines for JScript or VBScript, .NET while
calling it msxsl:script uses one of the .NET languages and compiles,
even if you use JScript.NET it is a completely different implementation
to the COM based JScript.
What is more important, the object model your "script" operates on when
XSLT/XPath passes in nodes (node sets) is completely different, with
MSXML it is the MSXML XML DOM but within .NET it is not DOM at all, how
the XSLT/XPath types translate into .NET types is documented here:
<http://msdn.microsoft. com/library/default.asp?url =/library/en-us/cpref/html/frlrfSystemXmlX slXslTransformC lassTopic.asp>

So you have
Node Set (XPath) as System.Xml.XPat h.XPathNodeIter ator
and
Result Tree Fragment (XSLT) as System.Xml.XPat h.XPathNavigato r
and need to use those APIs.
Note also that .NET 2.0 comes with a completely new XSLT implementation
though this document
<http://blogs.msdn.com/xmlteam/archive/2005/09/30/475922.aspx> claims
that migration from MSXML will be a bit easier as far as script is
concerned. But it also says
"In XslCompiledTran sform a binding (method name lookup) to script
functions happens at compile time, and stylesheets that are compliable
with XslTranform may throw an exception during compilation with
XslCompiledTran sform."
thus if you are now trying to move script in XSLT from MSXML to .NET
consider whether you do it in .NET 2.0 from the beginning.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '05 #3
Eugen Gulinsky wrote:
I am having problems trying to migrate our MSXML4-compatible stylesheets
containing large msxsl:script blocks to a formate understandable by
System.Xml:Xsl. XslTransform. I keep getting JS1135 errors saying that some
variable was not declared. This scripts worked perfectly with MSXML4. Is
there a guide for migraiton from MSXML to .NET or can you just give me some
tips on how to resolve this issues without having to change dozens of
working, already tested and deployaed XSLTs?


In general there is no easy way. Haven't you been aware that writing
stylesheets that heavily rely on extentions makes them nonportable?
If you have dozens stylesheets, just leave them alone, what's wrong with
MSXML4?
If you still want to upgrade I recommend moving to .NET 2.0 and
XslCompiledTran sform instead - JScript.NET 2.0 is more compatible with
JScript at syntax level.

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
Nov 13 '05 #4

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

Similar topics

4
2125
by: Rolf Kemper | last post by:
Hi All, ned help on the example below. It works fine for msxml3/4 but has problems with saxon. Saxon complains "can not find matching function ..... " My target is to write style sheets usable for msxml3 , msxml4 , saxon .. Is there a general solution ?
1
1620
by: Brandon Taylor | last post by:
Hi everyone, I'm using Visual Web Developer '05 beta, VB.NET, Access. I'm a complete newbie to .NET, so please bear with me! In classic ASP. I used to put my connection string in global.asa. Since web.config is XML, obviously I can't do a Server.MapPath() in that file. Of course I'll know the path to the DB while working locally, but what about when I'm ready to build my application and put it on a remote server in a shared hosting...
0
1543
by: Iain | last post by:
I think my .net application may have the following memory leak: http://support.microsoft.com/default.aspx?scid=KB;EN- US;Q316775& I am calling c# code from an xslt script using the msxsl:script tag. Every week or so, our company has to reboot our webserver due to a memory leak. We do run some asp apps off the server as well, but I'm pretty sure they are not the culprits.
6
2771
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
4
2633
by: Collin Peters | last post by:
I have searched the Internet... but haven't found much relating to this. I am wondering on what the best practices are for migrating a developmemnt database to a release database. Here is the simplest example of my situation (real world would be more complex). Say you have two versions of your application. A release version and a development version. After a month of developing you are ready to release a new version. There have...
0
843
by: Andreas Zita | last post by:
Hi I am using <msxsl:script> a lot in my stylesheets and Im looking for a way of sharing one set of script methods (perhaps an assembly?) between all my stylesheets rather than having copies of the same code. It would be nice if the application itself could handle these "extensions" and if any stylesheet on this app could use them only by implementing its namespace. Is this possible somehow? I'm having trouble finding info about this. ...
0
1045
by: pradeepap | last post by:
Hi, I am trying to return a form value from within a msxsl script. Please help me if i am doing it wrong. the code is as follows. <msxsl:script language="javascript" implements-prefix="user"> <!]> </msxsl:script>
6
16194
by: phnimx | last post by:
I'm attempting to migrate a predominately MFC application that I've just inherited from Visual Studio.NET 2003 to Visual Studio 2005. I've managed to clean up a myriad of compile and link errors but I'm stuck on one final problem. Please note that this application compiled/linked and ran just fine out of Visual Studio.NET 2003. Details: It's originally incarnated as an MFC app, i.e. CWinApp, CMultiDocTemplate,
0
1534
by: djnokturnal | last post by:
Hey! I am attempting to rewrite some old C# code in our code base that utilized DirectoryEntry to perform some LDAP queries. I am migrating it to the new System.DirectoryServices.AccountManagement namespace and have done about 90% of it, but one key aspect is still not done, and I stuck... I am attempting to access some custom ActiveDirectory fields, one being EmployeeNumber and for the life of me can't figure out how... Anyone have any...
0
9794
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
10780
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...
1
10539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10212
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
9319
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...
1
7753
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
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3968
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3077
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.