phing-filters

# Class: XsltFilter Source Location: /filters/XsltFilter.php
### Class Overview
    Reader
       |
       --FilterReader
          |
          --BaseFilterReader
             |
             --BaseParamFilterReader
                |
                --XsltFilter
Applies XSL stylesheet to incoming text. #### Author(s): Andreas Aderhold <andi@binarycloud.com> Hans Lellelid <hans@velum.net> Yannick Lecaillez <yl@seasonfive.com> #### Version: $Id: XsltFilter.php 557 2009-08-29 13:54:38Z mrook $ #### Copyright: © 2003 seasonfive. All rights reserved Implements interfaces: ChainableReader | ### Methods chain createParam getHtml getParams getResolveDocumentExternals getResolveStylesheetExternals getStyle process read setHtml setParams setResolveDocumentExternals setResolveStylesheetExternals setStyle
### Inherited Variables #### Class: BaseParamFilterReader BaseParamFilterReader::$_parameters #### Class: BaseFilterReader BaseFilterReader::$initialized BaseFilterReader::$project #### Class: FilterReader FilterReader::$in | ### Inherited Methods #### Class: BaseParamFilterReader BaseParamFilterReader::getParameters() BaseParamFilterReader::setParameters() #### Class: BaseFilterReader BaseFilterReader::__construct() Constructor used by Phing's introspection mechanism. BaseFilterReader::eof() Returns whether the end of file has been reached with input stream. BaseFilterReader::getInitialized() Returns the initialized status. BaseFilterReader::getProject() Returns the project this filter is part of. BaseFilterReader::log() Convenience method to support logging in filters. BaseFilterReader::read() Reads characters. BaseFilterReader::readLine() Reads a line of text ending with '\n' (or until the end of the stream). BaseFilterReader::setInitialized() Sets the initialized status. BaseFilterReader::setProject() Sets the project to work with. #### Class: FilterReader FilterReader::__construct() FilterReader::close() FilterReader::getResource() FilterReader::read() Read data from source. FilterReader::reset() FilterReader::setReader() FilterReader::skip() #### Class: Reader Reader::close() Close stream. Reader::getResource() Returns the filename, url, etc. that is being read from. Reader::mark() If supported, places a "marker" (like a bookmark) at current stream position. Reader::markSupported() Whether marking is supported. Reader::read() Read data from source. Reader::ready() Is stream ready for reading. Reader::reset() Reset the current position in stream to beginning or last mark (if supported). Reader::skip() Move stream position relative to current pos.
### Class Details [line 38] Applies XSL stylesheet to incoming text. Uses PHP XSLT support (libxslt). #### Tags:
author: | Andreas Aderhold <andi@binarycloud.com>
author: | Hans Lellelid <hans@velum.net>
author: | Yannick Lecaillez <yl@seasonfive.com>
version: | $Id: XsltFilter.php 557 2009-08-29 13:54:38Z mrook $
copyright: | © 2003 seasonfive. All rights reserved
see: | FilterReader
[ Top ] ### Class Methods ### method chain [line 297]
`Reader chain( $reader)`
Creates a new XsltFilter using the passed in Reader for instantiation. #### Tags:
return: | A new filter based on this configuration, but filtering the specified reader
Implementation of: ChainableReader::chain() Returns a reader with the same configuration as this one, but filtering input from the specified reader. #### Parameters:
Reader | $reader | A Reader object providing the underlying stream. Must not be null .
[ Top ] ### method createParam [line 87]
`XSLTParam createParam( )`
Create new XSLT Param object, to handle the <param/> nested element. [ Top ] ### method getHtml [line 123]
`boolean getHtml( )`
Whether to use HTML parser for the XML. This is supported in libxml2 -- Yay! [ Top ] ### method getParams [line 106]
`array getParams( )`
Returns the XSLT params set for this class. This is used to "clone" this class, in the chain() method. [ Top ] ### method getResolveDocumentExternals [line 159]
`bool getResolveDocumentExternals( )`
#### Tags:
since: | 2.4
[ Top ] ### method getResolveStylesheetExternals [line 179]
`bool getResolveStylesheetExternals( )`
#### Tags:
since: | 2.4
[ Top ] ### method getStyle [line 139]
`mixed getStyle( )`
Get the path to XSLT stylesheet. #### Tags:
return: | XSLT stylesheet path.
[ Top ] ### method process [line 244]
`void process( string $xml, string $xsl)`
Try to process the XSLT transformation #### Tags:
throws: | BuildException On XSLT errors
access: | protected
#### Parameters:
string | $xml | XML to process.
string | $xsl | XSLT sheet to use for the processing.
[ Top ] ### method read [line 188]
`string read( [ $len = null])`
Reads stream, applies XSLT and returns resulting stream. #### Tags:
return: | transformed buffer.
throws: | BuildException - if XSLT support missing, if error in xslt processing
Overrides BaseFilterReader::read() (Reads characters.) #### Parameters:
| $len |
[ Top ] ### method setHtml [line 131]
`void setHtml( boolean $b)`
Whether to use HTML parser for XML. #### Parameters:
boolean | $b |
[ Top ] ### method setParams [line 97]
`void setParams( array $params)`
Sets the XSLT params for this class. This is used to "clone" this class, in the chain() method. #### Parameters:
array | $params |
[ Top ] ### method setResolveDocumentExternals [line 150]
`void setResolveDocumentExternals( bool $resolveExternals)`
Whether to resolve entities in document. #### Tags:
since: | 2.4
#### Parameters:
bool | $resolveExternals |
[ Top ] ### method setResolveStylesheetExternals [line 170]
`void setResolveStylesheetExternals( bool $resolveExternals)`
Whether to resolve entities in stylesheet. #### Tags:
since: | 2.4
#### Parameters:
bool | $resolveExternals |
[ Top ] ### method setStyle [line 114]
`void setStyle( $file)`
Set the XSLT stylesheet. #### Parameters:
mixed | $file | PhingFile object or path.
[ Top ] Documentation generated on Mon, 19 Oct 2009 10:52:25 +0200 by phpDocumentor 1.4.3