473,614 Members | 2,089 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 6272
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
2754
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 are "atomic" or can they
1
3794
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 synchronously, whereas if there were no values caught in the calling code, they would perform asychronously....
19
4813
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 text file they can import (copy / paste) into their system with all their styles and layout...
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 the stylesheet uses the <msxsl:script> element and embeds C# code, but that's not a viable solution...
4
2024
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 that I can get a new list if an extension upgrades and adds new functions..? And what about PEAR..?...
5
5362
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 encoding instead of the wanted UTF-8. MSXML2.DOMDocument40Class stylesheet = new...
1
1368
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 functionality. Can anyone tell me any altenate method for doing the same. i mean
3
2096
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 System.Text; And Visual Studio 2007.
0
8182
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
8130
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8279
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
7093
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
6088
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
5540
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
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
1747
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.