You are here

public function QPXSL::xslt in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/Extension/QPXSL.php \QPXSL::xslt()
  2. 7.2 QueryPath/Extension/QPXSL.php \QPXSL::xslt()

File

QueryPath/Extension/QPXSL.php, line 14

Class

QPXSL

Code

public function xslt($style) {
  if (!$style instanceof QueryPath) {
    $style = qp($style);
  }
  $sourceDoc = $this->src
    ->top()
    ->get(0)->ownerDocument;
  $styleDoc = $style
    ->get(0)->ownerDocument;
  $processor = new XSLTProcessor();
  $processor
    ->importStylesheet($styleDoc);
  return qp($processor
    ->transformToDoc($sourceDoc));
}