Changeset 139

Show
Ignore:
Timestamp:
02/04/07 05:02:48 (2 years ago)
Author:
bkarwin
Message:

[Ticket 68] Add new filter class for Xinclude processing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/phing/types/FilterChain.php

    r123 r139  
    3535include_once 'phing/filters/TidyFilter.php'; 
    3636include_once 'phing/filters/TranslateGettext.php'; 
     37include_once 'phing/filters/XincludeFilter.php'; 
    3738include_once 'phing/filters/XsltFilter.php'; 
    3839 
     
    126127    } 
    127128     
     129    function addXincludeFilter(XincludeFilter $o) { 
     130        $o->setProject($this->project); 
     131        $this->filterReaders[] = $o; 
     132    } 
     133 
    128134    function addXsltFilter(XsltFilter $o) { 
    129135        $o->setProject($this->project); 
  • trunk/docs/phing_guide/book/chapters/appendixes/AppendixD-CoreTypes.html

    r123 r139  
    615615</table> 
    616616 
     617<h2><a name="XincludeFilter"></a>XincludeFilter</h2> 
     618<p> 
     619The <em>XincludeFilter</em> processes a stream for Xinclude tags, and processes the inclusions. 
     620This is useful for processing modular XML files.  DocBook book files are one example of  
     621modular XML files.  Usage example: 
     622<pre> 
     623&lt;!-- 
     624  Render a DocBook book file called manual.xml, which 
     625  contains Xinclude tags to include individual book sections. 
     626  --&gt; 
     627&lt;copy todir=&quot;${manual.dest.dir}&quot;&gt; 
     628  &lt;filterchain&gt; 
     629    &lt;xincludefilter basedir=&quot;${manual.src.dir}&quot; /&gt; 
     630    &lt;xsltfilter style=&quot;${manual.src.dir}/html.xsl&quot;&gt; 
     631      &lt;param name=&quot;base.dir&quot; expression=&quot;${manual.dest.dir}/&quot; /&gt; 
     632    &lt;/xsltfilter&gt; 
     633  &lt;/filterchain&gt; 
     634  &lt;fileset dir=&quot;${manual.src.dir}&quot;&gt; 
     635    &lt;include name=&quot;manual.xml&quot; /&gt; 
     636  &lt;/fileset&gt; 
     637&lt;/copy&gt; 
     638</pre> 
     639<h3>Attributes</h3> 
     640<table> 
     641  <caption> 
     642  Attributes for the <em>&lt;xincludefilter&gt;</em> tag 
     643  </caption> 
     644  <thead> 
     645    <tr> 
     646      <th>Name</th> 
     647      <th>Type</th> 
     648      <th>Description</th> 
     649      <th>Default</th> 
     650      <th>Required</th> 
     651    </tr> 
     652  </thead> 
     653  <tbody> 
     654    <tr> 
     655      <td>basedir</td> 
     656      <td>String</td> 
     657      <td> 
     658        The working directory from which to 
     659        process the Xincludes.  Relative pathnames 
     660        in the include tags are based on this 
     661        location. 
     662      </td> 
     663      <td>Project basedir</td> 
     664      <td>No</td> 
     665    </tr> 
     666  </tbody> 
     667</table> 
     668 
     669 
    617670<h2><a name="XsltFilter"></a>XsltFilter</h2> 
    618671<p>