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

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 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://tw.wordpress.org/plugins/xml-documents/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/xml-documents/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/xml-documents/#installation)
 * [開發資訊](https://tw.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 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.2.1**
 *  語言
 * [English (US)](https://wordpress.org/plugins/xml-documents/)
 * 標籤:
 * [cpt](https://tw.wordpress.org/plugins/tags/cpt/)[custom post type](https://tw.wordpress.org/plugins/tags/custom-post-type/)
   [tei](https://tw.wordpress.org/plugins/tags/tei/)[xml](https://tw.wordpress.org/plugins/tags/xml/)
   [xslt](https://tw.wordpress.org/plugins/tags/xslt/)
 *  [進階檢視](https://tw.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/)