public function render($writer)
{
if (($document = $this->getSourceXmlDocument()) === null) {
$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
parent::render($htmlWriter);
$document = new DOMDocument();
$document->loadXML($htmlWriter->flush());
}
$stylesheet = $this->getTransformXmlDocument();
// Perform XSL transformation
$xslt = new XSLTProcessor();
$xslt->importStyleSheet($stylesheet);
// Check for parameters
$parameters = $this->getParameters();
foreach ($parameters as $name => $value) {
$xslt->setParameter('', $name, $value);
}
$output = $xslt->transformToXML($document);
// Write output
$writer->write($output);
}