Hi all, i have a problem in getting back the node value that contains some white spaces. The language i used is VB. Belows is my coding:
- Code: Select all
Dim objDOM As New DOMDocument40
Dim nodeOne As IXMLDOMElement
objDOM.preserveWhiteSpace = True
Set nodeOne = objDOM.createElement("TestNode")
nodeOne.nodeTypedValue = Chr(13) & Chr(13) & Chr(10) & Chr(10) & Chr(32) & Chr(9) & " hello " & _
Chr(10) & Chr(10) & Chr(13) & Chr(13) & Chr(10) & Chr(32) & Chr(9) & _
"?" & Chr(13) & Chr(10) & Chr(32)
When i retrieve back the nodeOne value(1 character by 1 character), the charcter Chr(13) is missing. To solve that problem, i assign the node data type to "string" as shown as below:
- Code: Select all
nodeOne.dataType = "string"
This time all the characters(including character Chr(13) and Chr(10)) between "Hello" and "?" are preserved, but all the white spaces characters, Chr(13), Chr(10), Chr(9), Chr(32) before "Hello" and after "?" are missing. It seems like 'Trim' function in VB.
Can someone please help me to solve the problem?
Thank you..