downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

xslt_set_encoding> <xslt_process
[edit] Last updated: Fri, 17 May 2013

view this page in

xslt_set_base

(PHP 4 >= 4.0.5)

xslt_set_baseSetzt den Base-URI für alle XSLT-Transformationen

Beschreibung

void xslt_set_base ( resource $xh , string $uri )

Setzt den Base-URI für alle XSLT-Transformationen. Der Base-URI wird mit Xpath-Anweisungen verwendet, um document() und andere Kommandos aufzulösen, die auf externe Quellen zugreifen. Er wird ebenfalls verwendet, um URIs in <xsl:include>- und <xsl:import>-Elementen aufzulösen.

Parameter-Liste

xh

Der XSLT-Prozessor-Linkidentifier, der mittels xslt_create() erzeugt wurde.

uri

Der zu verwendende Base-URI.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Changelog

Version Beschreibung
4.3.0 Seit PHP 4.3.0 enthält der Base-URI als Standardwert das Verzeichnis des ausgeführten Skripts. Das entspricht dem Verzeichnisnamen in der __FILE__-Konstante. Der Standard-Base-URI ist in älteren Versionen nur schwer vorhersehbar.

Anmerkungen

Hinweis:

Wenn Sie Windows verwenden, beachten Sie bitte, vor Pfadangaben file:// zu schreiben.



xslt_set_encoding> <xslt_process
[edit] Last updated: Fri, 17 May 2013
 
add a note add a note User Contributed Notes xslt_set_base - [3 notes]
up
0
h0bby1 at yahoo dot com
5 years ago
i use xslt and page can be generated in two mode, one using <? xml-stylesheet href='page.xsl' >, one other using the php sablotron lib, the first one use path relative to the xsl file for includes , but the second with sablotron consider all the includes as relative to the set base path, is there any way to get sablotron to resolve include as relative to xslt file instead of the set_base for all files ?
up
0
edmon at oohaa dot net
8 years ago
$filebase = 'file://' . getcwd () . '/xsl/';
   xslt_set_base($xsltproc, $filebase);

file:// is needed for linux too.
php 4.3.8
up
0
Kelvin Cheng
9 years ago
It works great on my windows platform as below.

<?php
$xh
= xslt_create();
$fileBase = 'file://' . getcwd () . '/';
xslt_set_base ( $xh, $fileBase );

...

?>

Actually, it make use of the getcwd() to get the current directory. Hope it can help.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites