473,508 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ 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 6243
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
2750
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
3785
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
4797
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
401
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
2012
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
1238
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
5349
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
1363
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
2087
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
7229
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
7129
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
7333
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,...
0
5637
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
4716
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...
0
3208
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
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
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 ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.