Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

附录A:XML命名空间参考

本书常用的XML命名空间参考表:

前缀命名空间URI用途
whttp://schemas.openxmlformats.org/wordprocessingml/2006/mainWordprocessingML主命名空间,绝大多数元素
rhttp://schemas.openxmlformats.org/officeDocument/2006/relationships关系引用
ahttp://schemas.openxmlformats.org/drawingml/2006/mainDrawingML绘图
wphttp://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingWord绘图
pichttp://schemas.openxmlformats.org/drawingml/2006/picture图片
mchttp://schemas.openxmlformats.org/markup-compatibility/2006标记兼容性
cthttp://schemas.openxmlformats.org/package/2006/content-types内容类型
relhttp://schemas.openxmlformats.org/package/2006/relationships包级关系
cphttp://schemas.openxmlformats.org/package/2006/metadata/core-properties核心属性
dchttp://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就行。本书统一使用上面的前缀约定。