# classes/phing/filters/XsltFilter.php

## \XSLTParam
jump to top

Class that holds an XSLT parameter.

package
  phing.filters

### Properties

`$expr= ''`
Details

Type

`$name= ''`
Details

Type

### Methods

`getExpression( ) : string`
Returns expression value -- performs lookup if expr is registerslot.
Returns

Type | Description
--- | ---
string |

`getName( ) : string`
Get param name.
Returns

Type | Description
--- | ---
string |

`getValue( ) :`
Gets expression value (alias to the getExpression()) method.
Details

see
  \getExpression()

`setExpression( string $expr ) :`
Sets expression value.
Parameters

Name | Type | Description
--- | --- | ---
$expr | string |

`setListeningExpression( \RegisterSlot $expr ) :`
Sets expression to dynamic register slot.
Parameters

Name | Type | Description
--- | --- | ---
$expr | \RegisterSlot |

`setName( string $name ) :`
Sets param name.
Parameters

Name | Type | Description
--- | --- | ---
$name | string |

`setValue( string $v ) :`
Sets expression value (alias to the setExpression()) method.
Parameters

Name | Type | Description
--- | --- | ---
$v | string |

Details

see
  \setExpression()

## \XsltFilter
jump to top

Applies XSL stylesheet to incoming text.

Uses PHP XSLT support (libxslt).

Extends from
  \BaseParamFilterReader
Implements
  \ChainableReader
see
  \FilterReader
author
  Hans Lellelid
author
  Yannick Lecaillez
author
  Andreas Aderhold
copyright
  © 2003 seasonfive. All rights reserved
package
  phing.filters
version
  $Id: XsltFilter.php 557 2009-08-29 13:54:38Z mrook $

### Properties

`$html= 'false'`

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

Default value `false` Details

Type

`boolean $processed= 'false'`

Whether XML file has been transformed.

Default value `false` Details

Type
  boolean

`bool $resolveDocumentExternals= 'false'`

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).

Default value `false` Details

Type
  bool
since
  2.4

`bool $resolveStylesheetExternals= 'false'`

Whether to resolve entities in the stylesheet.

Default value `false` Details

Type
  bool
since
  2.4

`string $xslFile= 'null'`

Path to XSL stylesheet.

Default value `null` Details

Type
  string

`array $xsltParams= 'array'`

XSLT Params.

Default value `array` Details

Type
  array

### Methods

`_initialize( ) :`
Parses the parameters to get stylesheet path.
`chain( \Reader $reader ) : \Reader`
Creates a new XsltFilter using the passed in Reader for instantiation.
Parameters

Name | Type | Description
--- | --- | ---
$reader | \Reader | A Reader object providing the underlying stream. Must not be `null`.

Returns

Type | Description
--- | ---
\Reader |

`createParam( ) : \XSLTParam`
Create new XSLT Param object, to handle the nested element.
Returns

Type | Description
--- | ---
\XSLTParam |

`getHtml( ) : boolean`
Whether to use HTML parser for the XML.

This is supported in libxml2 -- Yay!

Returns

Type | Description
--- | ---
boolean |

`getParams( ) : array`
Returns the XSLT params set for this class.

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

Returns

Type | Description
--- | ---
array |

`getResolveDocumentExternals( ) : bool`
Returns

Type | Description
--- | ---
bool |

Details

since
  2.4

`getResolveStylesheetExternals( ) : bool`
Returns

Type | Description
--- | ---
bool |

Details

since
  2.4

`getStyle( ) : mixed`
Get the path to XSLT stylesheet.
Returns

Type | Description
--- | ---
mixed |

`process( string $xml, string $xsl ) :`
Try to process the XSLT transformation
Parameters

Name | Type | Description
--- | --- | ---
$xml | string | XML to process.
$xsl | string | XSLT sheet to use for the processing.

Details

throws
  On XSLT errors

`read( $len = null ) : string`
Reads stream, applies XSLT and returns resulting stream.
Parameters

Name | Type | Description
--- | --- | ---
$len |  |

Returns

Type | Description
--- | ---
string |

Details

throws
  - if XSLT support missing, if error in xslt processing

`setHtml( boolean $b ) :`
Whether to use HTML parser for XML.
Parameters

Name | Type | Description
--- | --- | ---
$b | boolean |

`setParams( array $params ) :`
Sets the XSLT params for this class.

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

Parameters

Name | Type | Description
--- | --- | ---
$params | array |

`setResolveDocumentExternals( bool $resolveExternals ) :`
Whether to resolve entities in document.
Parameters

Name | Type | Description
--- | --- | ---
$resolveExternals | bool |

Details

since
  2.4

`setResolveStylesheetExternals( bool $resolveExternals ) :`
Whether to resolve entities in stylesheet.
Parameters

Name | Type | Description
--- | --- | ---
$resolveExternals | bool |

Details

since
  2.4

`setStyle( mixed $file ) :`
Set the XSLT stylesheet.
Parameters

Name | Type | Description
--- | --- | ---
$file | mixed | PhingFile object or path.

Documentation was generated by DocBlox 0.13.1.