注釋: Add a few simple nodes with different datatypes
Set oNode = oDoc.createElement("Document")
oNode.Text = "Demo"
oRoot.appendChild oNode
Set oNode = oDoc.createElement("CreateDate")
oRoot.appendChild oNode
Set oEle = oNode
注釋: Use DataType so MSXML will validate the data type
oEle.dataType = "date"
oEle.nodeTypedValue = Now
Set oNode = oDoc.createElement("bgColor")
oRoot.appendChild oNode
Set oEle = oNode
注釋: Use DataType so MSXML will validate the data type
oEle.dataType = "bin.hex"
oEle.Text = &HFFCCCC
Set oNode = oDoc.createElement("Data")
oRoot.appendChild oNode
Set oEle = oNode
注釋: Use DataType so MSXML will validate the data type
oEle.dataType = "bin.base64"
注釋: Read in the data
oEle.nodeTypedValue = ReadBinData(DOCINPATH)
注釋: Save xml file
oDoc.save XMLOUTPATH
MsgBox XMLOUTPATH & " is created for you."
End Sub
Function ReadBinData(ByVal strFileName As String) As Variant
Dim lLen As Long
Dim iFile As Integer
Dim arrBytes() As Byte
Dim lCount As Long
Dim strOut As String
注釋:Read from disk
iFile = FreeFile()
相關(guān)推薦:北京 | 天津 | 上海 | 江蘇 | 山東 |
安徽 | 浙江 | 江西 | 福建 | 深圳 |
廣東 | 河北 | 湖南 | 廣西 | 河南 |
海南 | 湖北 | 四川 | 重慶 | 云南 |
貴州 | 西藏 | 新疆 | 陜西 | 山西 |
寧夏 | 甘肅 | 青海 | 遼寧 | 吉林 |
黑龍江 | 內(nèi)蒙古 |