Understand whitespace handling in Adobe FrameMaker and the whitespace normalization standard.
When you open an XML file in FrameMaker’s WYSIWYG View, the white spaces get normalized.
White space in XML is any character from the following set: space, tab and blank line/new line (except hard return). White space serves the following purposes:
Visually format the document in its source form, such as for code, to denote semantic significance for the XML document.
While using a text editor to edit XML, add spaces and line breaks into the element content model for better readability of the XML. This white space is not part of the information conveyed by the document and has no semantic significance for the XML application.
W3C has defined how white space in XML documents should White-space XML applications.
FrameMaker uses the following rules for white space normalization according to the standard:
XML ignores the first sequence of white space immediately after the opening tag and the last sequence of white space immediately before the closing tag.
XML translates non-space characters (tab and new-line) into a space character and consolidates all multiple space characters into a single space.
XML ignores the sequence of white space occurring between two elements if the parent element is defined to have element content.
You can set the xml:space
attribute of an
element to preserve to retain the white spaces. For example, if
we normalize the following (as appearing in the XML code view):
Hickory[SPACE][SPACE][SPACE]dikory dock.
The mouse[TAB][SPACE]ran up the clock.
It appears as (in WYSIWYG view):
Hickory[SPACE]dikory dock.
The mouse[SPACE]ran up the clock.
White space introduced through expansion of character references
(for example Space = 
Tab= 	
Newline=
)
is preserved on XML open. It is not considered white space per the above
rules.
For example, if FrameMaker normalizes the following (as appearing in the XML code view):
Hickory   dikory dock.
The mouse	 ran up the clock.
After normalization, tt appears as the following (in WYSIWYG view):
Hickory[SPACE][SPACE][SPACE]dikory dock.
The mouse[TAB][SPACE]ran up the clock.
To disable dropping whitespaces, set the property RemoveExtraWhiteSpacesOnXMLImport
in maker.ini to FALSE
.
If
the xml:space
attribute is set to preserve
(xml:space="preserve"
),
then FrameMaker preserves all whitespaces. You can use this setting
to preserve whitespaces for certain elements alone. This setting
lets FrameMaker drop whitespaces for all other elements in the WYSIWYG
View.