How does XML handle white-space in my documents?

来源:互联网 发布:怎样把淘宝宝贝排 编辑:程序博客网 时间:2024/05/22 00:30
<script type="text/javascript">google_ad_client = "pub-8800625213955058";/* 336x280, 创建于 07-11-21 */google_ad_slot = "0989131976";google_ad_width = 336;google_ad_height = 280;//</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>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.
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 儿童eb病毒感染症状 eb是什么车 eb车标 抗eb病毒衣壳抗原iga阳性 成人感染eb病毒能活多久 eb病毒衣壳抗原igg抗体阳性 eb病毒抗原igg抗体阳性 eb病毒抗体阳性会自愈吗 eb病毒抗体5项指标意义 eb病毒壳抗原igg抗体阳性 eb病毒核抗原igg抗体阳性 ed532 ed223 ed325 ed523 ed235 ed232 ed332 ed50 ed233 ed353 ed男 ed355 ed2000 ed什么意思 爱普生ed735x 3344ed在播放app ed病毒 孙尚香无惨ed2k ed病毒是什么 孙尚香ed2k ed模拟器 ed是什么 ed2kfile教师 000000ed 0000000ed 蓝屏代码ed 乚ed节能灯 蓝屏ed ed2k资源 ed患者是什么意思