Preserve Whitespace in DOM Object Problem

This is a discussion on "Preserve Whitespace in DOM Object Problem" within the Other Programming Languages section. This forum, and the thread "Preserve Whitespace in DOM Object Problem are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 27th, 2006, 09:28
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Preserve Whitespace in DOM Object Problem

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..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Reply

Tags
preserve, whitespace, dom, object, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Syntax problem -- object has no properties dsmithhfx JavaScript Forum 6 Jan 19th, 2008 20:30
preserve the back button action when doing AJAX calls pesho318i JavaScript Forum 2 Nov 28th, 2007 13:37
Problem with navbar background image - hyperlinking whitespace nicky77 Web Page Design 5 Aug 23rd, 2007 14:39
How do I preserve the appearance and still adjust for resolution? willow82 Web Page Design 1 Oct 18th, 2006 21:10
IIS (DB/Object Readonly) problem spinal007 Databases 2 Oct 19th, 2004 18:35


All times are GMT. The time now is 13:10.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved