This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DOCBOOK: DocBook XSL stylesheet loses whitespacewith MSXML


Kevin Yank wrote:

> After tinkering with an example from MSDN...
> 
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcexml
> xs/htm/ceconReleaseNotesHandlingWhiteSpaceWithMSXMLProcessor.asp>
> 
> It looks like it's whitespace-only nodes in the *output* document that
> get stripped by MSXML, not those in the input document. Does this jive
> with your knowledge of the issue, or am I way off track?

That's the different isue. Problem is on parser side. See snip from
MSXML SDK:

  Microsoft XML Core Services (MSXML) 4.0 - DOM Reference  

See Also
text Property | xml Property

Applies to: DOMDocument
Language
C/C++

Script

Visual Basic

Show All
preserveWhiteSpace Property  [Script]
Specifies the default white space handling.

[Script] 
Script Syntax
boolVal = objXMLDOMDocument.preserveWhiteSpace;
objXMLDOMDocument.preserveWhiteSpace = boolVal;
Example
The following script example first loads and displays a file with the
preserveWhiteSpace property set to True and then reloads and displays
the file with the preserveWhiteSpace property set to False.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.preserveWhiteSpace = true;
xmlDoc.load("books.xml");
alert(xmlDoc.xml);
xmlDoc.async = false;
xmlDoc.preserveWhiteSpace = false;
xmlDoc.load("books.xml");
alert(xmlDoc.xml);
[Visual Basic] 
Visual Basic Syntax
boolVal = objXMLDOMDocument.preserveWhiteSpace;
objXMLDOMDocument.preserveWhiteSpace = boolVal;
Example
The following MicrosoftŽ Visual BasicŽ example first loads and displays
a file with the preserveWhiteSpace property set to True and then reloads
and displays the file with the preserveWhiteSpace property set to False.

Dim xmlDoc As New Msxml2.DOMDocument40
xmlDoc.async = False
xmlDoc.preserveWhiteSpace = True
xmlDoc.Load ("books.xml")
MsgBox xmlDoc.xml
xmlDoc.async = False
xmlDoc.preserveWhiteSpace = False
xmlDoc.Load ("books.xml")
MsgBox xmlDoc.xml
[C/C++] 
C/C++ Syntax
HRESULT get_preserveWhiteSpace(
    VARIANT_BOOL *isPreserving);
HRESULT put_preserveWhiteSpace(
    VARIANT_BOOL isPreserving);
Parameters
isPreserving [out, retval][in] 
The value that indicates whether default processing preserves white
space. 
C/C++ Return Values
S_OK 
The value returned if successful. 
E_INVALIDARG (for get_preserveWhiteSpace only) 
The value returned if isPreserving is Null. 
Remarks
Boolean. The property is read/write. This property is initialized to
False.

The preserveWhiteSpace property specifies the default white space
handling. When preserveWhiteSpace is True, all white space is preserved,
regardless of any xml:space attributes specified in the document type
definition (DTD). It is equivalent to having an xml:space= "preserve"
attribute on every element.

When preserveWhiteSpace is False, the values of any xml:space attributes
determine where white space is preserved.

The xml property does not preserve white space exactly as it appears in
the original document. Instead, the object model replaces white space
present in the original document with a single newline character in the
representation returned by the xml property. In a similar way, the text
property contains a representation without the leading and trailing
spaces and replaces multiple intervening white space characters between
words with a single space character.

The text and xml properties preserve white space when the
preserveWhiteSpace property is set to True and xml:space on the XML
element has the value "preserve."

This member is an extension of the Worldwide Web Consortium (W3C)
Document Object Model (DOM).

To view reference information for Visual Basic, C/C++, or Script only,
click the Language Filter button  in the upper-left corner of the page.

See Also
text Property | xml Property

Applies to: DOMDocument
 
 
-- 
-----------------------------------------------------------------
  Jirka Kosek  	                     
  e-mail: jirka@kosek.cz
  http://www.kosek.cz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]