Skip to content
Snippets Groups Projects

Dev#73871 minsoc xlst etape 2 association fichier xslt

Closed Ghislain Loas requested to merge dev#73871_minsoc_xlst_etape_2_association_fichier_xslt into WIP
Viewing commit 1826dfb4
Show latest version
2 files
+ 25
4
Preferences
Compare changes
Files
2
@@ -25,7 +25,9 @@ class Class_Notice_Xsl {
const KEY = 'xslt';
protected static $_xslt_processor;
protected static
$_xslt_processor,
$_dom_document;
protected
$_record,
@@ -35,6 +37,7 @@ class Class_Notice_Xsl {
public static function reset() {
static::$_xslt_processor = null;
static::$_dom_document = null;
static::setPhpCommand(null);
static::setYaz(null);
}
@@ -121,7 +124,7 @@ class Class_Notice_Xsl {
public function importStylesheet($path) {
$xsl = new DOMDocument();
$xsl = $this->getDomDocument();
$xsl->load($path);
$xslt = $this->getXSLTProcessor();
@@ -132,7 +135,7 @@ class Class_Notice_Xsl {
public function transformToXml($path) {
$xml = new DOMDocument();
$xml = $this->getDomDocument();
$xml->load($path);
return $this->getXSLTProcessor()->transformToXml($xml);
@@ -142,11 +145,23 @@ class Class_Notice_Xsl {
public function getXSLTProcessor() {
return static::$_xslt_processor
? static::$_xslt_processor
: new XSLTProcessor();
: (static::$_xslt_processor = new XSLTProcessor());
}
public static function setXSLTProcessor($xslt_processor) {
static::$_xslt_processor = $xslt_processor;
}
public function getDomDocument() {
return static::$_dom_document
? static::$_dom_document
: new DOMDocument;
}
public static function setDomDocument($dom_document) {
static::$_dom_document = $dom_document;
}
}
\ No newline at end of file