BizTalk Utilities CV ,   Jobs ,   Code library  
 
 

Microsoft DOM Objects Reference

Download ReferenceDownload this Reference 

Previous PageTable Of ContentsIndexNext Page

preserveWhiteSpace

Is a member of:

XMLDOMDocument

Syntax

blnValue = objDOMDocument.preserveWhiteSpace

objDOMDocument.preserveWhiteSpace = blnValue

Remark

This property is a readable and writable property that returns True/False. The default is False. White space is a space, tab, or carriage return (new line) character in your XML file.

This property is useful when you need to preserve the layout (white space) of the data in your XML document. For example, you have as one of your elements a comment that consists of sentences. You would need to preserve the two spaces after a full stop, the carriage return between paragraphs. Well, if you did not specify to preserve the white space for this element, you would lose all this formatting.

In the XML specifications, all white space is meant to be preserved; however, the default behavior of this property in the DOMDocument is False, and as such, the XML and TEXT properties do not preserve the white space.

The text and XML properties will preserve white space when the user has set the preserveWhiteSpace property to True and/or when the xml:space attribute on the XML element has the value preserve. Depending on which you choose from the previous line; the DOMDocument object handles the white space differently.

There are different types of white space:

Preserved: the content of the DOMDocument will be exactly as it's found in the XML file

Trimmed: the leading and trailing spaced in your XML file are removed

Half-preserved: the white space inside your text is preserved, but the white space between tags is normalized

To find more information about how setting your white space affects the output of your text in the DOMDocument, go to the Microsoft website, which explains this quite well.

Example

The following XML example specifies that the white space needs to be preserved:

<ADDRESS>xml:space="preserve">

911 Somewhere Circle,

Canberra,

Australia

</ADDRESS>

Now this data will keep its form when it is displayed.

Previous PageTable Of ContentsIndexNext Page

This manuscript is an abridged version of a chapter from the Manning Publications book XML Programming with VB and ASP. This chapter looks at the Microsoft DOM objects. NOTE: Most images have been removed to increase speed and many of the code comments have also been removed for presentation. Please purchase the book to enjoy the full experience of all the chapters with images and code comments!

 

Recent Jobs

A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En
A Greate Opportunituy as a SQL Deve
An immediate job opportunity as a B

View all Jobs (Add yours)
View all CV (Add yours)



Information Online

swimming pool builder
chicago web site design
spfxmasks
Cheap Web Hosting
conference calling
Prada sunglasses
answering service


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP