PHP 8.5.0 Alpha 1 available for testing

Voting

: min(five, one)?
(Example: nine)

The Note You're Voting On

rbmeo at yahoo dot com
12 years ago
To make your import dynamic, try this code:

<?php
$dom
= new DOMDocument();
$dom->load('main.xsl');
$xpath = new DomXPath($dom);
$importnode= $questionsXsl->createElement('xsl:include');
$attr= $questionsXsl->createAttribute('href');
$attr->value = 'import.xsl';
$importnode->appendChild($attr);
$dom->documentElement->insertBefore($importnode,$ref);
$dom->loadXml($dom->saveXml());
?>

this code basically loads the main stylesheet, prepend the import xsl code then reload as xml string so the imported stylesheet will be loaded at dom.

<< Back to user notes page

To Top