473,699 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using MSXML v 2.6 w/ .NET

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 according to their business
rules. This works great except one of our new clients uses and older system
which requires ascii characters which are excluded by the W3C
recommendation. So we can't use a true, fully compliant Xslt 1.0 processing
engine.

CURRENT STATUS:
Since v 2.6 allows all ascii characters I can get the stylesheet to work
from the command line usnig the MSXML command line utility by specifying
the -u (version) parameter. So now all I need to do is find a way to declare
which version of MSXML I am using from .NET.

Thank you in advance for any input.
Nov 12 '05 #1
19 4816
use com interop. from a .net project, select references. click on the COM tab and point to the MSXML.dll (the version you're talking about). you can then use an Imports MSXML statement in a clas

i use the msxml 4.0 version using Interop. you can check if this works for v2.
----- Mark Miller wrote: ----

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 expor
their data and pass it thru a custom Xslt stylesheet we have created fo
their print system. The idea of the whole process for them is they reques
the export and then they get a text file they can import (copy / paste) int
their system with all their styles and layout according to their busines
rules. This works great except one of our new clients uses and older syste
which requires ascii characters which are excluded by the W3
recommendation. So we can't use a true, fully compliant Xslt 1.0 processin
engine

CURRENT STATUS
Since v 2.6 allows all ascii characters I can get the stylesheet to wor
from the command line usnig the MSXML command line utility by specifyin
the -u (version) parameter. So now all I need to do is find a way to declar
which version of MSXML I am using from .NET

Thank you in advance for any input

Nov 12 '05 #2
Thanks,

It works great. I found a VB sample for working w/ v2.6 here:
http://www.informit.com/articles/art...31449&seqNum=3

Here is what I did in C#:

public string Transform(strin g sXML, string XSLTPath){
StringBuilder sbXML = new StringBuilder() ;

MSXML2.DOMDocum ent26Class XmlDoc26 = new MSXML2.DOMDocum ent26Class();
MSXML2.FreeThre adedDOMDocument 26Class XsltDoc26 = new
MSXML2.FreeThre adedDOMDocument 26Class();
MSXML2.XSLTempl ate26Class Xslt26 = new MSXML2.XSLTempl ate26Class();
MSXML2.IXSLProc essor XslProc26;

XmlDoc26.async = false;
XmlDoc26.loadXM L(sXML);

XsltDoc26.async = false;
XsltDoc26.load( XSLTPath);

Xslt26.styleshe et = XsltDoc26;
XslProc26 = Xslt26.createPr ocessor();

XslProc26.input = XmlDoc26;
if(XslProc26.tr ansform()){
sbXML.Append(Xs lProc26.output) ;
}

return sbXML.ToString( );
}
Nov 12 '05 #3
Please be aware, all, what you describe is not supported.
http://support.microsoft.com/default...b;en-us;815112

-Dino

"Mark Miller" <bl***@blank.co m> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Thanks,

It works great. I found a VB sample for working w/ v2.6 here:
http://www.informit.com/articles/art...31449&seqNum=3

Here is what I did in C#:

public string Transform(strin g sXML, string XSLTPath){
StringBuilder sbXML = new StringBuilder() ;

MSXML2.DOMDocum ent26Class XmlDoc26 = new MSXML2.DOMDocum ent26Class();
MSXML2.FreeThre adedDOMDocument 26Class XsltDoc26 = new
MSXML2.FreeThre adedDOMDocument 26Class();
MSXML2.XSLTempl ate26Class Xslt26 = new MSXML2.XSLTempl ate26Class();
MSXML2.IXSLProc essor XslProc26;

XmlDoc26.async = false;
XmlDoc26.loadXM L(sXML);

XsltDoc26.async = false;
XsltDoc26.load( XSLTPath);

Xslt26.styleshe et = XsltDoc26;
XslProc26 = Xslt26.createPr ocessor();

XslProc26.input = XmlDoc26;
if(XslProc26.tr ansform()){
sbXML.Append(Xs lProc26.output) ;
}

return sbXML.ToString( );
}

Nov 12 '05 #4
is there a MS website that lists all their COM interops that they DON'T recommend/support

for e.g. i use the MSXML 4.0 and the Web Browser control all the time using .NET interop services. ofcourse i never bothered to check support issues mostly because it worked

Nov 12 '05 #5
tMan wrote:
is there a MS website that lists all their COM interops that they DON'T recommend/support?
I think that's obvious that any neglecting native .NET functionality
isn't recommended.
for e.g. i use the MSXML 4.0 and the Web Browser control all the time using .NET interop services. ofcourse i never bothered to check support issues mostly because it worked.

I'm not sure about Web Browser control, but using MSXML in .NET is
definitely a bit weird. And as anything weird that's not recommended
(and usually is not supported, what is a different matter).
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #6
Oleg,

Oleg Tkachenko [MVP] wrote:
I'm not sure about Web Browser control, but using MSXML in .NET is
definitely a bit weird. And as anything weird that's not recommended
(and usually is not supported, what is a different matter).


From the pure usability standpoint, MSXML looks a more mature product;
I don't think it is weird to use it in .NET instead of a much weaker
aboriginal counterpart. We at RenderX pick MSXML as the default
parser/transformer for our XSL-FO implementation under .NET.
The reasons are:

- the .NET component is terribly slow - about 3 times slower than MSXML
in our tests. It takes nearly the same time to transform as to generate
the PDF, a real nonsense for people with Java background :-);

- it is less compliant: we could not overcome problems with the document()
function in XSLT, and attribute whitespace normalization in XML parser.

You can test it yourself: the .NET version of our tool has an option to
switch between the two. Just feed it a big file to transform (e.g. the XSL
spec itself), and feel the difference :-).

Regards,
Nikolai Grigoriev
RenderX

Nov 12 '05 #7
Oleg Tkachenko [MVP] wrote:
I think that's obvious that any neglecting native .NET functionality isn't recommended
i agree on the recommendation
but using MSXML in .NET is definitely a bit weird. And as anything weird that's not recommended


i disagree. the computing world is full of heterogeneous systems, data sources, services, frameworks and legacy applications

my primary reason to use msxml was
- if i have (read client) invested heavily in a MSXML-DOM processing codebase, or for e.g. an ADO middle tier codebase that works really well, i won't necessarily rewrite everything in .NET. in other words i built a new .NET project but i used existing logic or components that were already there and working

here's a comparison between MSXML and .NET XM
http://www.ondotnet.com/pub/a/dotnet...4/xsltperf.htm

Nov 12 '05 #8
Ice
in light of the document that is shared and if i were to accept the results,
it would seem interesting that MS would be pushing everyone off MSXML.

Any additional thoughts?

ice
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!P LEASEtkachenko. com> wrote in message
news:es******** ******@tk2msftn gp13.phx.gbl...
tMan wrote:
is there a MS website that lists all their COM interops that they DON'T
recommend/support?
I think that's obvious that any neglecting native .NET functionality
isn't recommended.
for e.g. i use the MSXML 4.0 and the Web Browser control all the time
using .NET interop services. ofcourse i never bothered to check support
issues mostly because it worked. I'm not sure about Web Browser control, but using MSXML in .NET is
definitely a bit weird. And as anything weird that's not recommended
(and usually is not supported, what is a different matter).
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com

Nov 12 '05 #9
Ice wrote:
in light of the document that is shared and if i were to accept the results,
it would seem interesting that MS would be pushing everyone off MSXML.


What do you mean exactly?

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

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

Similar topics

9
1787
by: LarryR | last post by:
The following XSLT works fine using MSXML 4.0 (e.g I receive a result in about 20 seconds), but effectively hangs in both .NET 1.0 sp2 with the XML hot fix and NET 1.1. My source XML file is large at over 46,000 <atl_client> nodes <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <!-- lookup port...
6
6285
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...
1
1354
by: Michael McCarthy | last post by:
using MSXML.dll, I have the following code: XMLHTTPRequest tempXML = new XMLHTTPRequest(); string strURL = "http://someURIgoeshere.com/"; try { tempXML.open("GET", strURL, false, "", ""); tempXML.send(null); e.Result = tempXML; }
0
1437
by: MLH | last post by:
In the following code snippet, notice ("PIN=1234567890&MSSG=Here+is+a+short+message+-+no+spaces+-+just+plusses&Q1=0") I have it that way because I thought PLUSes were required and that spaces would not work. But I have tried ("PIN=1234567890&MSSG=Here is a short message - no spaces - just plusses&Q1=0") and the msXML.Send call works perfectly. Does anyone know how or why the PLUSes came to be used in the first place?
1
2439
by: Michael Nemtsev | last post by:
Any kind of differences? Were they buid on the common base or different? -- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche
0
1453
by: MLH | last post by:
http://www.alltel.com/text_messaging/ Above is the URL to which one would direct his browser to send text message to Alltel customer. I wrote a VBA script to automate text messaging field personnel with a construction company last year. All field reps carried Arch pagers. Arch.com is NOT affiliated with Alltel. Faced with a similar objective, how do I go about determining the URL I need to use with Alltel? I don't imagine its the same as...
3
70196
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
5
5369
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...
4
2504
by: Nuno | last post by:
Hello, I'm trying to call some web services only using javascript from a html page. I succeeded on doind this in IE with the use of the behavior:url(webservice.htc); (technique founded in the microsft site) but when i'm going to try this in a diferente browser (firefox for example) the behavior command is not accepted in this browser. So i try to find why and i don't understand, but i found a way of calling web services using the mozila...
0
8687
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
9174
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...
0
9034
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
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
8883
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
7750
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
6534
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...
1
3057
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
2
2347
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.