我正在将VB6代码转换为C#.net。 IXSLProcessor xslProcessor.input接受DomDocument,但我有XmlDocument。在转换时(从xml到DomDocument),它会抛出异常。是否可以将XmlDocument转换为DomDocument?代码是
Object vntRetVal;
ADODB.Stream objStream;
XSLTemplate xsl;
IXSLProcessor xslProcessor;
DocSys.IField objField = null;
String strFormatting=string.Empty;
String strValue;
Boolean blnManual;
XmlElement nd;
int m;
int n;
String[] bstr;
object[] astr = null;
objStream = new ADODB.Stream();
objStream.Open()
xslProcessor = xsl.createProcessor();
xslProcessor.addParameter("mergeindex", m_Model.MailMerge.Items.Current);
DOMDocument dom1 = new DOMDocument();
dom1 =(DOMDocument)m_Model.Document.get_Data;
xslProcessor.input = dom1;
xslProcessor.output = objStream;
xslProcessor.transform();
objStream.Position = 0;
strValue = objStream.ReadText();