XsltFilter

Extends \BaseParamFilterReader Implements \ChainableReader

Applies XSL stylesheet to incoming text.

Uses PHP XSLT support (libxslt).

author

Hans Lellelid hans@velum.net

author

Yannick Lecaillez yl@seasonfive.com

author

Andreas Aderhold andi@binarycloud.com

see
package

phing.filters

Methods

__construct

__construct(\Reader $in = null) 
inherited

Arguments

$in

\Reader

Parses the parameters to get stylesheet path.

_initialize() 

Creates a new XsltFilter using the passed in Reader for instantiation.

chain(\Reader $reader) : \XsltFilter

Arguments

$reader

\Reader

Response

\XsltFilter

A new filter based on this configuration, but filtering

               the specified reader

Close stream.

close() 
inherited abstract
throws

if there is an error closing stream

Create new XSLT Param object, to handle the <param/> nested element.

createParam() : \XSLTParam

Response

\XSLTParam

Returns whether the end of file has been reached with input stream.

eof() : boolean
inherited

Response

boolean

Whether to use HTML parser for the XML.

getHtml() : boolean

This is supported in libxml2 -- Yay!

Response

boolean

Returns the initialized status.

getInitialized() : boolean
inherited

Response

boolean

whether or not the filter is initialized

Returns the parameters to be used by this filter.

getParameters() : array
inherited

Response

array

the parameters to be used by this filter

Returns the XSLT params set for this class.

getParams() : array

This is used to "clone" this class, in the chain() method.

Response

array

Returns the project this filter is part of.

getProject() : object
inherited

Response

object

The project this filter is part of

getResolveDocumentExternals

getResolveDocumentExternals() : boolean
since 2.4

Response

boolean

getResolveStylesheetExternals

getResolveStylesheetExternals() : boolean
since 2.4

Response

boolean

Returns the filename, url, etc. that is being read from.

getResource() : string
inherited abstract

This is critical for, e.g., ExpatParser's ability to know the filename that is throwing an ExpatParserException, etc.

Response

string

Get the path to XSLT stylesheet.

getStyle() : mixed

Response

mixed

XSLT stylesheet path.

Convenience method to support logging in filters.

log(string $msg, integer $level = \Project::MSG_INFO) : void
inherited

Arguments

$msg

string

Message to log.

$level

integer

Priority level.

If supported, places a "marker" (like a bookmark) at current stream position.

mark() 
inherited

A subsequent call to reset() will move stream position back to last marker (if supported).

Whether marking is supported.

markSupported() : boolean
inherited

Response

boolean

Try to process the XSLT transformation

process(string $xml, string $xsl) : string
throws

On XSLT errors

Arguments

$xml

string

XML to process.

$xsl

string

XSLT sheet to use for the processing.

Response

string

Read data from source.

read(integer $len = null) 
inherited abstract

If length is specified, then only that number of chars is read, otherwise stream is read until EOF.

Arguments

$len

integer

Reads a line of text ending with '\n' (or until the end of the stream).

readLine() : string
inherited

The returned String retains the '\n'.

throws

if the underlying reader throws one during

                reading

Response

string

the line read, or null if the end of the

        stream has already been reached

Is stream ready for reading.

ready() : boolean
inherited

Response

boolean

Reset the current position in stream to beginning or last mark (if supported).

reset() 
inherited

Whether to use HTML parser for XML.

setHtml(boolean $b) 

Arguments

$b

boolean

Sets the initialized status.

setInitialized(boolean $initialized) 
inherited

Arguments

$initialized

boolean

Whether or not the filter is initialized.

Sets the parameters used by this filter, and sets the filter to an uninitialized status.

setParameters(array $parameters) : void
inherited
throws

Arguments

$parameters

array

Array of parameters to be used by this filter.

         Should not be <code>null</code>.

Sets the XSLT params for this class.

setParams(array $params) 

This is used to "clone" this class, in the chain() method.

Arguments

$params

array

Sets the project to work with.

setProject(object|\Project $project) 
inherited

Arguments

$project

object|\Project

The project this filter is part of.

                   Should not be <code>null</code>.

setReader

setReader(\Reader $in) 
inherited

Arguments

$in

\Reader

Whether to resolve entities in document.

setResolveDocumentExternals(boolean $resolveExternals) 
since 2.4

Arguments

$resolveExternals

boolean

Whether to resolve entities in stylesheet.

setResolveStylesheetExternals(boolean $resolveExternals) 
since 2.4

Arguments

$resolveExternals

boolean

Set the XSLT stylesheet.

setStyle(mixed $file) 

Arguments

$file

mixed

PhingFile object or path.

Move stream position relative to current pos.

skip(integer $n) 
inherited

Arguments

$n

integer

Properties

Path to XSL stylesheet.

xslFile : string
var

Type(s)

string

Whether XML file has been transformed.

processed : boolean
var

Type(s)

boolean

XSLT Params.

xsltParams : array
var

Type(s)

array

Whether to use loadHTML() to parse the input XML file.

html : 

Type(s)

Whether to resolve entities in the XML document (see {@link http://www.php.net/manual/en/class.domdocument.php#domdocument.props.resolveexternals} for more details).

resolveDocumentExternals : boolean
var
since

Type(s)

boolean

Whether to resolve entities in the stylesheet.

resolveStylesheetExternals : boolean
var
since

Type(s)

boolean

The passed in parameter array.

_parameters : array
inherited
var

Type(s)

array

Have the parameters passed been interpreted?

initialized : 
inherited

Type(s)

The Phing project this filter is part of.

project : 
inherited

Type(s)

in

in : \Reader
inherited
var

Type(s)

\Reader