xml文档可以进行扩展以携带更多的信息。 请看下面的xml note 例子:
< note>
< to>tove< /to>
< from>jani< /from>
< body>dont forget me this weekend!< /body>
< /note>
想象一下,我们创建了一个应用程序,它把 < to>、< from>和< body>元素从 xml 文档中提取出来,生成了这样的输出:
message
to: tove
from: jani
dont forget me this weekend!
假如这个xml文档的作者又向其中增加了一些额外信息:
< note>
< date>1999-08-01< /date>
< to>tove< /to>
< from>jani< /from>
< heading>reminder< /heading>
< body>dont forget me this weekend!< /body>
< /note>
那么这个应用程序会不会出故障呢? 不会的,应用程序还是会从xml文档中找到< to>、< from>和< body> 元素而生成同样的输出。 xml文档是可以扩展的。
