Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How does XML handle white-space in my documents
How does XML handle white-space in my documents?
✍: FYICENTER.com
All white-space, including linebreaks, TAB characters, and normal spaces, even between structural elements where no text can ever appear, is passed by the parser unchanged to the application (browser, formatter, viewer, converter, etc), identifying the context in which the white-space was found (element content, data content, or mixed content, if this information is available to the parser, eg from a DTD or Schema). This means it is the application's responsibility to decide what to do with such space, not the parser's:
The parser must inform the application that white-space has occurred in element content, if it can detect it. (Users of SGML will recognize that this information is not in the ESIS, but it is in the Grove.)
<chapter>
<title>
My title for
Chapter 1.
</title>
<para>
text
</para>
</chapter>
In the example above, the application will receive all the pretty-printing linebreaks, TABs, and spaces between the elements as well as those embedded in the chapter title. It is the function of the application, not the parser, to decide which type of white-space to discard and which to retain. Many XML applications have configurable options to allow programmers or users to control how such white-space is handled.
2007-04-11, 5144👍, 0💬
Popular Posts:
How To Fade Image Edges to Background Colors? - PSP Tutorials - Fading Images to Background Colors w...
What is the output of printf("%d")? 1. When we write printf("%d",x); this means compiler will print ...
Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a chang...
What Is a CAPTION Tag/Element? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells A "capti...
What is V model in testing? V model map’s the type of test to the stage of development in a project....