Bonjour,
J'utilise xsl:import pour surcharger les feuilles de style de la TEI; pour cela j'utilise une 3ème xsl définit ainsi:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
<?xml version="1.0" encoding="UTF-8"?>
	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
		<xsl:import href="adresse_serveur/tei/Stylesheets/xhtml/tei.xsl"/>
		<xsl:import href="./affichage.xsl"/>
	</xsl:stylesheet>
Or, je voudrais pouvoir définir dynamiquement adresse_serveur; j'ai procédé comme suit: Sur ma page php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
$xq = new xqueryBP();
$fragment = $xq->getFragment($ref_bib, $num_frag);
$xml=new DOMDocument();
		$xml->loadXML('<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="'.PATH_APPLICATION.'/templates/affichage_fragment.xsl"?>'.$fragment);
 
		$xsl=new DOMDocument();
		$xsl->load(PATH_APPLICATION.'/templates/affichage_fragment.xsl', LIBXML_NOCDATA);
 
		$proc = new XSLTProcessor();
		$proc->setParameter('', 'path_appli', '/home/www/dev');
		$proc->importStylesheet($xsl);
Dans affichage_fragment.xsl :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
<?xml version="1.0" encoding="UTF-8"?>
	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
		<xsl:import href="$path_appli/tei/Stylesheets/xhtml/tei.xsl"/>
		<xsl:import href="./affichage_fragment_BP_diplo.xsl"/>
	</xsl:stylesheet><xsl:param name="path_appli"/>
Cela ne fonctionne pas;et retourne les erreurs suivantes:
Warning: DOMDocument::load() [function.DOMDocument-load]: Extra content at the end of the document in /home/web/dossiers-flaubert.dev/templates/affichage_fragment_diplo.xsl, line: 6 in /home/web/dossiers-flaubert.dev/templates/affichage_fragment_v4.php on line 68

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: compilation error in /home/web/dossiers-flaubert.dev/templates/affichage_fragment_v4.php on line 72

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: xsltParseStylesheetProcess : empty stylesheet in /home/web/dossiers-flaubert.dev/templates/affichage_fragment_v4.php on line 72
Warning: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml]: No stylesheet associated to this object in /home/web/dossiers-flaubert.dev/templates/affichage_fragment_v4.php on line 161
Comment faire pour passer un paramètre à mon fichier xsl pour définir dynamiquement le chemin de la feuille de style a surcharger?