Cannot Get Whitespace Characters
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 8
- Joined: Wed Nov 09, 2005 12:31 pm
Cannot Get Whitespace Characters
I have a problem to get the content's characters using DOM object in VB. Belows are my coding:
When i retrieve back the content(one chanracter by one character) from nodeOne, the character Chr(13) has missing.
Because of that, i add a line of coding to assign the node data type to "string" as shown as belows:
now, the characters Chr(13) is preserved but the problem now is all the whitespaces infront of "Hello" and all the whitespaces after the character "?" has missing. It seems like 'Trim' function in VB.
Can someone know how to preserve all the whitespaces, please reply my message.
Thank you.
Code: Select all
Dim objDOM As New DOMDocument40
Dim nodeOne As IXMLDOMElement
objDOM.preserveWhiteSpace = True
Set nodeOne = objDOM.createNode("element", "TestNode", "")
nodeOne.nodeTypedValue = Chr(13) & Chr(10) & Chr(32) & Chr(9) & " hello " & _
Chr(10) & Chr(13) & Chr(32) & Chr(9) & _
"?" & Chr(13) & Chr(10) & Chr(32)
Because of that, i add a line of coding to assign the node data type to "string" as shown as belows:
Code: Select all
nodeOne.dataType = "string"
Can someone know how to preserve all the whitespaces, please reply my message.
Thank you.
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service