Title: XML Documents
Author: mitcho (Michael Yoshitaka Erlewine)
Published: <strong>2011 年 5 月 27 日</strong>
Last modified: 2011 年 5 月 31 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/xml-documents.svg)

# XML Documents

 作者：[mitcho (Michael Yoshitaka Erlewine)](https://profiles.wordpress.org/mitchoyoshitaka/)

[下载](https://downloads.wordpress.org/plugin/xml-documents.0.2.zip)

 * [详情](https://cn.wordpress.org/plugins/xml-documents/#description)
 * [评价](https://cn.wordpress.org/plugins/xml-documents/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/xml-documents/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/xml-documents/#developers)

 [支持](https://wordpress.org/support/plugin/xml-documents/)

## 描述

This plugin adds the necessary infrastructure to add a “XML Document”-type custom
post type which renders an XML document with an XSLT stylesheet in lieu of the regular
post content. This can be useful in custom applications where there is a need to
display XML documents from source, but you also want the regular benefits of WordPress
tagging, commenting, etc. for these documents.

This plugin will not work out of the box… it is an infrastructure plugin. Additional
coding (albeit minor) is necessary to get it running. See the “Installation” section
for more information and sample code.

The development of this plugin is supported by [MIT Global Shakespeares](http://globalshakespeares.org),
where it will be used to render the full text of Shakespeare plays from TEI-XML 
source.

### To-do

 * Custom stylesheets, per-document and/or custom parameters to be passed to the
   XSL transform
 * Search integration

## 屏幕截图

 * [[
 * A custom post type with XML Document support: here, “Scripts” for the display
   of Shakespeare scripts.
 * [[
 * Selecting an uploaded XML Document as the document to be rendered.

## 安装

 1. Make sure you have PHP5 and [the PHP XSL module](http://us3.php.net/xsl) installed.
 2. Install and activate this plugin.
 3. Create a new custom post type with the `supports` attribute `xmldoc`. This custom
    post type will completely ignore its `post_content`, so make sure its `supports`
    statement does not include `editor`.
 4. Place your stylesheet in your current theme’s directory, named as `stylesheet.xsl`.
 5. Create a new entity of your new post type. There will be an option to upload and
    choose an XML document (see screenshots). Do that, publish it, and view it, and
    you will see the XML document rendered with the XSLT as the content of that entry.

Here’s some sample code:

    ```
    register_post_type('script',
        array(
            'label' => 'Scripts',
            'public' => true,
            'hierarchical' => false,
            'supports' => array('title', 'comments', 'xmldoc')
        )
    );
    ```

For more information on `register_post_type` and Custom Post Types, [visit the Codex](https://codex.wordpress.org/Post_Types).

## 常见问题

  Your question here!

Our answer here!

## 评价

此插件暂无评价。

## 贡献者及开发者

「XML Documents」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ mitcho (Michael Yoshitaka Erlewine) ](https://profiles.wordpress.org/mitchoyoshitaka/)

[帮助将「XML Documents」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/xml-documents)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/xml-documents/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/xml-documents/)，或通过[RSS](https://plugins.trac.wordpress.org/log/xml-documents/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/xml-documents/)。

## 更新日志

#### 0.2

 * A couple bugfixes for the admin interface.

#### 0.1

 * Initial public release.

## 额外信息

 *  版本 **0.2**
 *  最后更新：**15 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.1 或更高版本 **
 *  已测试的最高版本为 **3.2.1**
 *  语言
 * [English (US)](https://wordpress.org/plugins/xml-documents/)
 * 标签
 * [cpt](https://cn.wordpress.org/plugins/tags/cpt/)[custom post type](https://cn.wordpress.org/plugins/tags/custom-post-type/)
   [tei](https://cn.wordpress.org/plugins/tags/tei/)[xml](https://cn.wordpress.org/plugins/tags/xml/)
   [xslt](https://cn.wordpress.org/plugins/tags/xslt/)
 *  [高级视图](https://cn.wordpress.org/plugins/xml-documents/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/xml-documents/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/xml-documents/reviews/)

## 贡献者

 *   [ mitcho (Michael Yoshitaka Erlewine) ](https://profiles.wordpress.org/mitchoyoshitaka/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/xml-documents/)