\QueryPath\ExtensionQPXSL

Provide tools for running XSL Transformation (XSLT) on a document.

This extension provides the QPXSL::xslt() function, which transforms a source XML document into another XML document according to the rules in an XSLT document.

This QueryPath extension can be used as follows: <?php require 'QueryPath/QueryPath.php'; require 'QueryPath/Extension/QPXSL.php';

qp('src.xml')->xslt('stylesheet.xml')->writeXML(); ?>

This will transform src.xml according to the XSLT rules in stylesheet.xml. The results are returned as a QueryPath object, which is written to XML using \QueryPath\Extension\QueryPath::writeXML().

Summary

Methods
Properties
Constants
__construct()
xslt()
No public properties found
No constants found
No protected methods found
$src
N/A
No private methods found
No private properties found
N/A

Properties

$src

$src : 

Type

Methods

__construct()

__construct(\QueryPath\Query  $qp) 

Parameters

\QueryPath\Query $qp

xslt()

xslt(mixed  $style) : \QueryPath\Extension\QueryPath

Given an XSLT stylesheet, run a transformation.

This will attempt to read the provided stylesheet and then execute it on the current source document.

Parameters

mixed $style

This takes a QueryPath object or any of the types that the {@link qp()} function can take.

Returns

\QueryPath\Extension\QueryPath —

A QueryPath object wrapping the transformed document. Note that this is a different document than the original. As such, it has no history. You cannot call {@link QueryPath::end()} to undo a transformation. (However, the original source document will remain unchanged.)