Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : XSLT Functions : xslt_set_base

xslt_set_base

Set the base URI for all XSLT transformations (PHP 4 >= 4.0.5)
void xslt_set_base ( resource xh, string uri )

Sets the base URI for all XSLT transformations, the base URI is used with Xpath instructions to resolve document() and other commands which access external resources. It is also used to resolve URIs for the <xsl:include> and <xsl:import> elements.

Parameters

xh

The XSLT processor link identifier, created with xslt_create().

uri

The base URI to be used.

Return Values

No value is returned.

ChangeLog

Version Description
4.3.0 As of PHP 4.3.0, the default base URI is the directory of the executing script. In effect, it is the directory name value of the __FILE__ constant. The default base URI is less predictable with older versions.

Notes

Note:

Please note that file:// is needed in front of path if you use Windows.

Code Examples / Notes » xslt_set_base

kelvin cheng

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.


edmon

$filebase = 'file://' . getcwd () . '/xsl/';
  xslt_set_base($xsltproc, $filebase);
file:// is needed for linux too.
php 4.3.8


Change Language


Follow Navioo On Twitter
xslt_backend_info
xslt_backend_name
xslt_backend_version
xslt_create
xslt_errno
xslt_error
xslt_free
xslt_getopt
xslt_process
xslt_set_base
xslt_set_encoding
xslt_set_error_handler
xslt_set_log
xslt_set_object
xslt_set_sax_handler
xslt_set_sax_handlers
xslt_set_scheme_handler
xslt_set_scheme_handlers
xslt_setopt
eXTReMe Tracker