TXmlTransform uses the PHP's XSL extension to perform {@link http://www.w3.org/TR/xslt XSL transformations} using the {@link http://xmlsoft.org/XSLT/ libxslt library}. To associate an XML style sheet with TXmlTransform set the {@link setTransformPath TransformPath} property to the namespace or path to the style sheet or set the {@link setTransformContent TransformContent} property to the XML style sheet data as a string. To associate the XML data to be transformed set the {@link setDocumentPath DocumentPath} property to the namespace or path to the XML document or set the {@link setDocumentContent DocumentContent} property to the XML data as a string. To add additional parameters to the transformation process you can use the {@link getParameters Parameters} property.
С версии: 3.1
Автор: Knut Urdalen (knut.urdalen@gmail.com)
Автор: Qiang Xue (qiang.xue@gmail.com)
Наследование: extends Prado\Web\UI\TControl
Пример #1
0
 public function testRenderWithDocumentPathAndTransformPath()
 {
     $expected = "<b>Hello World!</b>\n";
     $transform = new TXmlTransform();
     $transform->setDocumentPath($this->documentPath);
     $transform->setTransformPath($this->transformPath);
     $textWriter = new TTextWriter();
     $htmlWriter = new THtmlWriter($textWriter);
     $transform->render($htmlWriter);
     $actual = $textWriter->flush();
     self::assertEquals($expected, $actual);
 }