ignorableWhitespace Method

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Reference

ignorableWhitespace Method

This method is not called in the current implementation because the Simple API for XML (SAX2) implementation is nonvalidating.

[Visual Basic]

You can manually call the ignorableWhitespace method to pass white space characters such as space, carriage return (CR), tab, or line feed (LF) to the internal buffer of the MXXMLWriter object.

Implementation Syntax

Sub ignorableWhitespace(strChars As String)

Usage Syntax

Dim stringOfXml As String
stringOfXml = xmlDoc.xml
oContentHandler.ignorableWhitespace stringOfXml

Parameters

strChars
The character data.

Return Values

If failed, the ContentHandler raises a trappable error.

Example

The following example shows how to manually call the ignorableWhitespace method. This method finds ignorable white space characters in character data and replaces them with two characters of white space. In this case, the tab character is replaced.

Private Sub IVBSAXContentHandler_characters(strChars As String)
    If strChars Like vbTab Or strChars Like "*[vbTab]*" Then
       Call IVBSAXContentHandler_ignorableWhitespace(strChars)
    End If
    strChars = Replace(strChars, vbLf, vbCrLf)
    Form1.TextBox1.Text = Form1.TextBox1.Text & strChars
End Sub

Private Sub IVBSAXContentHandler_ignorableWhitespace(strChars As String)
   strChars = Replace(strChars, vbTab, "  ")
End Sub
[C/C++]

You can manually call the ignorableWhitespace method to pass ignorable white space characters to MXXMLWriter.

Syntax

HRESULT ignorableWhitespace(
   [in] const wchar_t * pwchChars,
   [in] int cchChars);

Parameters

pwchChars [in]
The character data.
cchChars [in]
The length of the character string.

Return Values

S_OK
The value returned if the character data is returned successfully.
E_FAIL
The value returned if an internal error occurs.

Remarks

The ignorableWhitespace method does not convert CR/LF("\r\n") to the Java LF('\n') implementation.

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

See Also

Use MXXMLWriter

Applies to: ISAXContentHandler/IVBSAXContentHandler Interface