2008年8月12日星期二

将XML转换成通用XSL作为DOM物件引入recordset

Dim Rs As ADODB.Recordset
Dim xml As MSXML2.DOMDocument
Dim xsl As MSXML2.DOMDocument
Dim newdom As MSXML2.DOMDocument


Private Sub Command1_Click()
Commd.ShowOpen
If Commd.FileName <> "" Then
txtFile.Text = Commd.FileName
Set xml = New MSXML2.DOMDocument
Set xsl = New MSXML2.DOMDocument
Set newdom = New MSXML2.DOMDocument
Set Rs = New ADODB.Recordset
xml.Load txtFile.Text
xsl.Load App.Path + "\temp.xsl"
xml.transformNodeToObject xsl, newdom
Rs.Open newdom
End If
End Sub

没有评论: