From 7645a7b438e71d8d500f1d8863ebf7baf391173d Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Fri, 27 Apr 2012 10:38:21 -0300 Subject: [PATCH] Format XSLT and pass parameters. --- ObjectHelper.inc | 10 +++++++- xsl/convertQDC.xsl | 62 +++++++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 0aa5f590..ac5f9048 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -432,9 +432,17 @@ class ObjectHelper { if (($xsl_path = "$path/xsl/convertQDC.xsl") && ($xsl = DOMDocument::load($xsl_path)) && ($ds = DOMDocument::loadXML($xmlstr))) { + $xslt_opts = array( + 'BASEURL' => $base_url, + 'PATH' => url($path, array('absolute' => TRUE)), + 'baseUrl' => $base_url, //XXX: Deprecated; just here for legacy cases. + 'path' => url($path, array('absolute' => TRUE)), //XXX: Deprecated; just here for legacy cases. + ); $transform = new XSLTProcessor(); $transform->importStylesheet($xsl); - return $transform->transformToXML($ds); + $transform->setParameter('', $xslt_opts); + $transformed = $transform->transformToDoc($ds); + return $transformed->saveHTML(); } else { $simplexml = new SimpleXMLElement($xmlstr); diff --git a/xsl/convertQDC.xsl b/xsl/convertQDC.xsl index 5d881e35..62edd12e 100644 --- a/xsl/convertQDC.xsl +++ b/xsl/convertQDC.xsl @@ -1,33 +1,33 @@ - - - - - - - - -
- - - - - - - - - - -

MetaData

- -
- = -
-
-
- -
- - -
\ No newline at end of file + + + + + +
+ + + + + + + + + + + + + + + + + +

MetaData

+ +
+
+
+
+
+