使用MSXML v 2.6 w / .NET [英] Using MSXML v 2.6 w/ .NET

查看:56
本文介绍了使用MSXML v 2.6 w / .NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

有谁知道如何使用.NET的MSXML解析器的v2.6?


背景:

I网络打印允许我们的客户(报纸)输出他们的数据并通过我们为他们的打印系统创建的自定义Xslt样式表传递它的过程。对他们来说整个过程的想法是他们要求导出出来然后他们得到一个文本文件,他们可以导入(复制/粘贴)到他们的系统中的所有他们的系统根据他们的业务风格和布局

规则。这很好用,除了我们的一个新客户使用和旧系统

,这需要ascii字符,这些字符被W3C推荐
推荐。所以我们不能使用真正的,完全兼容的Xslt 1.0处理

引擎。


当前状态:

自v 2.6允许所有ascii字符我可以通过指定

-u(version)参数从命令行使用MSXML命令行实用程序来使样式表工作

。所以现在我需要做的就是找到一种方法来声明

我在.NET中使用的MSXML版本。


提前感谢您的任何输入。

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.

推荐答案

使用com interop。从.net项目中,选择引用。单击COM选项卡并指向MSXML.dll(您正在讨论的版本)。然后你可以在clas中使用Imports MSXML语句


我使用Interop的msxml 4.0版本。你可以查看这是否适用于v2。

----- Mark Miller写道:----


问题

有谁知道如何使用.NET的MSXML解析器的v2.6


我是Web to Print。允许我们的客户(报纸)通过我们创建的定制Xslt样式表传递他们的数据并将其传递给他们的打印系统的过程。对他们来说整个过程的想法是他们要求导出然后他们得到一个文本文件,他们可以导入(复制/粘贴)int

他们的系统所有他们的根据他们的商业风格和布局

规则。除了我们的一个新客户使用和较旧的系统

这需要ascii字符被W3

推荐排除外,这种方法很有效。所以我们不能使用真正的,完全符合标准的Xslt 1.0处理器

引擎


当前状态

因为v 2.6允许所有ascii字符我可以通过指定

-u(版本)参数从命令行获取样式表以获取MSXML命令行实用程序。所以现在我需要做的就是找到一种方法来声明

我在.NET中使用哪个版本的MSXML


提前感谢您的任何输入

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


谢谢,


它很棒。我在这里找到了一个用于w / v2.6的VB样本:
http://www.informit.com/articles/art...31449&seqNum=3


这是我做的在C#中:


public string Transform(string sXML,string XSLTPath){

StringBuilder sbXML = new StringBuilder();


MSXML2.DOMDocument26Class XmlDoc26 = new MSXML2.DOMDocument26Class();

MSXML2.FreeThreadedDOMDocument26Class XsltDoc26 = new

MSXML2.FreeThreadedDOMDocument26Class();

MSXML2.XSLTemplate26Class Xslt26 = new MSXML2.XSLTemplate26Class();

MSXML2.IXSLProcessor XslProc26;


XmlDoc26.async = false;

XmlDoc26.loadXML(sXML);


XsltDoc26.async = false;

XsltDoc26.load(XSLTPath);

Xslt26.stylesheet = XsltDoc26;

XslProc26 = Xslt26.createProcessor();


XslProc2 6.input = XmlDoc26;

if(XslProc26.transform()){

sbXML.Append(XslProc26.output);

}


返回sbXML.ToString();

}
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(string sXML, string XSLTPath){
StringBuilder sbXML = new StringBuilder();

MSXML2.DOMDocument26Class XmlDoc26 = new MSXML2.DOMDocument26Class();
MSXML2.FreeThreadedDOMDocument26Class XsltDoc26 = new
MSXML2.FreeThreadedDOMDocument26Class();
MSXML2.XSLTemplate26Class Xslt26 = new MSXML2.XSLTemplate26Class();
MSXML2.IXSLProcessor XslProc26;

XmlDoc26.async = false;
XmlDoc26.loadXML(sXML);

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

Xslt26.stylesheet = XsltDoc26;
XslProc26 = Xslt26.createProcessor();

XslProc26.input = XmlDoc26;
if(XslProc26.transform()){
sbXML.Append(XslProc26.output);
}

return sbXML.ToString();
}


请注意,所有,你是什么不支持describe。
http ://support.microsoft.com/default...b; zh-CN; 815112

-Dino


马克米勒 < BL *** @ blank.com>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Please be aware, all, what you describe is not supported.
http://support.microsoft.com/default...b;en-us;815112

-Dino

"Mark Miller" <bl***@blank.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
谢谢,

它很棒。我在这里找到了一个用于w / v2.6的VB样本:
http://www.informit.com/articles/art...31449&seqNum=3

这是我在C#中所做的:<公共字符串转换(字符串sXML,字符串XSLTPath){
StringBuilder sbXML = new StringBuilder();

MSXML2.DOMDocument26Class XmlDoc26 = new MSXML2.DOMDocument26Class();
MSXML2.FreeThreadedDOMDocument26Class XsltDoc26 = new
MSXML2.FreeThreadedDOMDocument26Class();
MSXML2.XSLTemplate26Class Xslt26 = new MSXML2.XSLTemplate26Class();
MSXML2.IXSLProcessor XslProc26;

XmlDoc26.async = false;
XmlDoc26.loadXML(sXML);

XsltDoc26.async = false;
XsltDoc26.load(XSLTPath);
< brs> Xslt26.stylesheet = XsltDoc26;
XslProc26 = Xslt26.createProcessor();

XslProc26.input = XmlDoc26;
if(XslProc26.transform()){
sbXML.Ap pend(XslProc26.output);
}
返回sbXML.ToString();
}
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(string sXML, string XSLTPath){
StringBuilder sbXML = new StringBuilder();

MSXML2.DOMDocument26Class XmlDoc26 = new MSXML2.DOMDocument26Class();
MSXML2.FreeThreadedDOMDocument26Class XsltDoc26 = new
MSXML2.FreeThreadedDOMDocument26Class();
MSXML2.XSLTemplate26Class Xslt26 = new MSXML2.XSLTemplate26Class();
MSXML2.IXSLProcessor XslProc26;

XmlDoc26.async = false;
XmlDoc26.loadXML(sXML);

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

Xslt26.stylesheet = XsltDoc26;
XslProc26 = Xslt26.createProcessor();

XslProc26.input = XmlDoc26;
if(XslProc26.transform()){
sbXML.Append(XslProc26.output);
}

return sbXML.ToString();
}



这篇关于使用MSXML v 2.6 w / .NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆