Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1530362
  • 博文数量: 3500
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 43870
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-03 20:31
文章分类

全部博文(3500)

文章存档

2008年(3500)

我的朋友

分类:

2008-05-04 20:01:55

一起学习
The SGML rules regarding white-space have been changed for XML. All white-space, including linebreaks, TAB characters, and regular spaces, even between those 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). This means it is the application's responsibility to decide what to do with such space, not the parser's: insignificant white-space between structural elements (space which occurs where only element content is allowed, ie between other elements, where text data never occurs) will get passed to the application (in SGML this white-space gets suppressed, which is why you can put all that extra space in HTML documents and not worry about it. This is not so in XML); significant white-space (space which occurs within elements which can contain text and markup mixed together, usually mixed content or PCDATA) will still get passed to the application exactly as under SGML. It is the application's responsibility to handle it correctly. My title for Section 1.

text

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.) In the above example, 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. 下载本文示例代码


How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?How does XML handle white-space in my documents?
阅读(98) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~