473,585 Members | 2,552 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 6265
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!P LEASEtkachenko. com> wrote in message
news:<ex******* *******@TK2MSFT NGP11.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!P LEASEtkachenko. com> wrote in message
news:<ex******* *******@TK2MSFT NGP11.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
2753
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. The question came up if this is by itself thread safe, if some two or more threads try to change these data types, are the C functions by themselves...
1
3793
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. He has a dummy variable in the calling code to catch it. He said that by both returning and catching this dummy value, the POSTs perform...
19
4805
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 custom Xslt stylesheet we have created for their print system. The idea of the whole process for them is they request the export and then they get 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# extension functions with the MSXML objects? More specifically to use a C# class which has all my extension functions. I've seen examples where...
4
2023
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 editor and the XML validator? Thanks, Mike Jansen
1
1243
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 name functions). Is there a table which has the name of the extension and the functions included in the particular extension..? Is there a way...
5
5358
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 commandline call to MSXML. The problem is that the dotnet variant leaves out a piece of info on the charset, leading to the browser going to a default...
1
1365
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 supports this by using an addObject() method. I got some information that mozilla does not support this methods.but in their firefox 3 they added some...
3
2093
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 not recognized). I am using the 'standard' using directives using System;using System.Collections.Generic;using System.Diagnostics;using...
0
7836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8336
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...
0
8212
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...
0
6606
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...
1
5710
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...
0
5389
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...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2343
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
1
1447
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.