附录A:XML命名空间参考
本书常用的XML命名空间参考表:
| 前缀 | 命名空间URI | 用途 |
|---|---|---|
w | http://schemas.openxmlformats.org/wordprocessingml/2006/main | WordprocessingML主命名空间,绝大多数元素 |
r | http://schemas.openxmlformats.org/officeDocument/2006/relationships | 关系引用 |
a | http://schemas.openxmlformats.org/drawingml/2006/main | DrawingML绘图 |
wp | http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing | Word绘图 |
pic | http://schemas.openxmlformats.org/drawingml/2006/picture | 图片 |
mc | http://schemas.openxmlformats.org/markup-compatibility/2006 | 标记兼容性 |
ct | http://schemas.openxmlformats.org/package/2006/content-types | 内容类型 |
rel | http://schemas.openxmlformats.org/package/2006/relationships | 包级关系 |
cp | http://schemas.openxmlformats.org/package/2006/metadata/core-properties | 核心属性 |
dc | http://purl.org/dc/elements/1.1/ | Dublin Core元数据 |
在根元素上声明例子:
<w:document
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">
前缀可以自己定,只要绑定到正确的URI就行。本书统一使用上面的前缀约定。