473,466 Members | 3,167 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# extension functions using MSXML?

I'm having performance/memory problems using .NET's XslTransform class so I
thought I'd give the MSXML object's a whirl.

The question I haven't been able to find in these groups is can I use C#
extension functions with the MSXML objects? More specifically to use a C#
class which has all my extension functions.

I've seen examples where the stylesheet uses the <msxsl:script> element and
embeds C# code, but that's not a viable solution for my situation since I'll
be maintaining lots of different stylesheets which require the same
extension functions. (if I make one edit to an extension function, I don't
want to open up 20 other files and make the same edits)

Thanks,
-A
Nov 12 '05 #1
6 6231
Alfred Taylor wrote:
I'm having performance/memory problems using .NET's XslTransform class so I
thought I'd give the MSXML object's a whirl.
Have you optimized your code, as recommended in "Improving XML
Performance" paper? [1]
The question I haven't been able to find in these groups is can I use C#
extension functions with the MSXML objects? More specifically to use a C#
class which has all my extension functions.
You cannot. MSXML only supports scripting languages like JScript or
VBScript for extension functions.
Well, basically COM can call .NET code via interop (read about COM
Callable Wrappers in .NET), so you can register a .NET assembly on the
machine and then call its methods from COM.
But I doubt that's going to improve your perf problem, not to mention
lots of additional problems with interop. You can try it though.
I've seen examples where the stylesheet uses the <msxsl:script> element and
embeds C# code, but that's not a viable solution for my situation since I'll
be maintaining lots of different stylesheets which require the same
extension functions. (if I make one edit to an extension function, I don't
want to open up 20 other files and make the same edits)


That won't work with MSXML anyway.

[1]
http://msdn.microsoft.com/library/de...netchapt09.asp

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2
Alfred Taylor wrote:
I'm having performance/memory problems using .NET's XslTransform class so I
thought I'd give the MSXML object's a whirl.
Have you optimized your code, as recommended in "Improving XML
Performance" paper? [1]
The question I haven't been able to find in these groups is can I use C#
extension functions with the MSXML objects? More specifically to use a C#
class which has all my extension functions.
You cannot. MSXML only supports scripting languages like JScript or
VBScript for extension functions.
Well, basically COM can call .NET code via interop (read about COM
Callable Wrappers in .NET), so you can register a .NET assembly on the
machine and then call its methods from COM.
But I doubt that's going to improve your perf problem, not to mention
lots of additional problems with interop. You can try it though.
I've seen examples where the stylesheet uses the <msxsl:script> element and
embeds C# code, but that's not a viable solution for my situation since I'll
be maintaining lots of different stylesheets which require the same
extension functions. (if I make one edit to an extension function, I don't
want to open up 20 other files and make the same edits)


That won't work with MSXML anyway.

[1]
http://msdn.microsoft.com/library/de...netchapt09.asp

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

Thanks for your response. I have a couple questions below.

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:<ex**************@TK2MSFTNGP11.phx.gbl>...
Alfred Taylor wrote:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl.
Have you optimized your code, as recommended in "Improving XML
Performance" paper? [1]


Nope, looks like the article came out last month so I haven't come across it
yet. Looks like a good comprehensive article which I'll be sure to read.
The question I haven't been able to find in these groups is can I use C#
extension functions with the MSXML objects? More specifically to use a C# class which has all my extension functions.
You cannot. MSXML only supports scripting languages like JScript or
VBScript for extension functions.


Slightly confused here. You say no here, but it looks like below you say it
is possible through COM. Is that right?
Well, basically COM can call .NET code via interop (read about COM
Callable Wrappers in .NET), so you can register a .NET assembly on the
machine and then call its methods from COM.
But I doubt that's going to improve your perf problem, not to mention
lots of additional problems with interop. You can try it though.
I'm familiar with creating CCW in .NET, just not with the syntax of MSXML.
I don't suppose you could provide a quick example of how you would use a COM
object for extension functions in MSXML? The other thing is, a lot of
people compare the speed improvements of MSXML over the .NET implementation,
however, not much is mentioned about memory. For my particular situation,
I'm more concerned with memory. How do the two implementations compare? Is
it neglible enough to not bother wasting my time testing MSXML?

Thanks,
-Alfred
I've seen examples where the stylesheet uses the <msxsl:script> element and embeds C# code, but that's not a viable solution for my situation since I'll be maintaining lots of different stylesheets which require the same
extension functions. (if I make one edit to an extension function, I don't want to open up 20 other files and make the same edits)
That won't work with MSXML anyway.

[1]

http://msdn.microsoft.com/library/de...netchapt09.asp
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com

Nov 12 '05 #4
Hi Oleg,

Thanks for your response. I have a couple questions below.

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:<ex**************@TK2MSFTNGP11.phx.gbl>...
Alfred Taylor wrote:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl.
Have you optimized your code, as recommended in "Improving XML
Performance" paper? [1]


Nope, looks like the article came out last month so I haven't come across it
yet. Looks like a good comprehensive article which I'll be sure to read.
The question I haven't been able to find in these groups is can I use C#
extension functions with the MSXML objects? More specifically to use a C# class which has all my extension functions.
You cannot. MSXML only supports scripting languages like JScript or
VBScript for extension functions.


Slightly confused here. You say no here, but it looks like below you say it
is possible through COM. Is that right?
Well, basically COM can call .NET code via interop (read about COM
Callable Wrappers in .NET), so you can register a .NET assembly on the
machine and then call its methods from COM.
But I doubt that's going to improve your perf problem, not to mention
lots of additional problems with interop. You can try it though.
I'm familiar with creating CCW in .NET, just not with the syntax of MSXML.
I don't suppose you could provide a quick example of how you would use a COM
object for extension functions in MSXML? The other thing is, a lot of
people compare the speed improvements of MSXML over the .NET implementation,
however, not much is mentioned about memory. For my particular situation,
I'm more concerned with memory. How do the two implementations compare? Is
it neglible enough to not bother wasting my time testing MSXML?

Thanks,
-Alfred
I've seen examples where the stylesheet uses the <msxsl:script> element and embeds C# code, but that's not a viable solution for my situation since I'll be maintaining lots of different stylesheets which require the same
extension functions. (if I make one edit to an extension function, I don't want to open up 20 other files and make the same edits)
That won't work with MSXML anyway.

[1]

http://msdn.microsoft.com/library/de...netchapt09.asp
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com

Nov 12 '05 #5
Alfred Taylor wrote:
You cannot. MSXML only supports scripting languages like JScript or
VBScript for extension functions.

Slightly confused here. You say no here, but it looks like below you say it
is possible through COM. Is that right?


MSXML allows JScript/VBScript extensions, where you can instantiate
ActiveX objects and I presume work with COM somehow.
I'm familiar with creating CCW in .NET, just not with the syntax of MSXML.
That's just VBScript or JScript.
I don't suppose you could provide a quick example of how you would use a COM
object for extension functions in MSXML? The other thing is, a lot of
people compare the speed improvements of MSXML over the .NET implementation,
however, not much is mentioned about memory. For my particular situation,
I'm more concerned with memory. How do the two implementations compare? Is
it neglible enough to not bother wasting my time testing MSXML?


I'm not sure what's the best here. You better try and measure.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #6
Alfred Taylor wrote:
You cannot. MSXML only supports scripting languages like JScript or
VBScript for extension functions.

Slightly confused here. You say no here, but it looks like below you say it
is possible through COM. Is that right?


MSXML allows JScript/VBScript extensions, where you can instantiate
ActiveX objects and I presume work with COM somehow.
I'm familiar with creating CCW in .NET, just not with the syntax of MSXML.
That's just VBScript or JScript.
I don't suppose you could provide a quick example of how you would use a COM
object for extension functions in MSXML? The other thing is, a lot of
people compare the speed improvements of MSXML over the .NET implementation,
however, not much is mentioned about memory. For my particular situation,
I'm more concerned with memory. How do the two implementations compare? Is
it neglible enough to not bother wasting my time testing MSXML?


I'm not sure what's the best here. You better try and measure.

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

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

Similar topics

8
by: Torsten Mohr | last post by:
Hi, i write an extension module in C at the moment. This module does some work on some own data types that consist of some values. The functions that can change the data are written in C. ...
1
by: Brad | last post by:
A long-time JScript/IE programmer friend of mine shared a technique with me recently that puzzles me. He has a series of functions that perform POSTs, with each function returning a dummy value. ...
19
by: Mark Miller | last post by:
QUESTION: Does anyone know how I can use v2.6 of the MSXML parser with .NET? BACKGROUND: I "Web to Print" process that allows our clients (newspapers) to export their data and pass it thru a...
0
by: Alfred Taylor | last post by:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C#...
4
by: Mike Jansen | last post by:
Does anyone know why if I create a complexType based off another complexType using xsd:extension the attributes don't seem to be inherited? Is this a bug/non-implementation in the .NET Schema...
1
by: pek | last post by:
I want to create an application that will scan a series of .php files, look the functions availiable in them, and display which extensions it is using (don't know how to avoid user made conflicted...
5
by: Jeroen | last post by:
We're using MSXML to transform the XML document we have to an XHTML file using an XSLT. Now the problem is that the dotnet implementation we made does something subtly different from the...
1
by: shidhincr | last post by:
Hi,, Can anybody tell me how mozilla implements the extension functions for its XSLT processor. presently we are not able to make new extension functions and call it in the XSL files. But IE...
3
by: raylopez99 | last post by:
The headline says it all. Great minds think alike: read the blog below from three years ago, as endorsed by Ritchie, who coinvented C. BTW the below lambda expression code will not work (.Where...
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
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...
1
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...
0
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...
0
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,...
0
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...
0
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...
0
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 ...

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.