Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I got this problem including an XSL stylesheet (cannot open file...). I've been Googling around, and it seems a common problem, but the solutions don't work for me. This is the PHP code to parse the XSL file: $xh = xslt_create(); $fileBase = 'file://var/www/html/site123/pages/xsl/'; xslt_set_base($xh, $fileBase); $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $args, $params); This is the XSL include tag: <xsl:include href="login_box.xsl"/> I'm not sure whether to use file:// or not. I guess it's for Windows servers only and we're using Apache/Unix with PHP 4.2. But if I don't use file://, I get another ugly error (arg not found). Please don't refer me to: http://be.php.net/manual/en/function.xslt-set-base.php Been there, and the provided solutions don't work. I also can't use getcwd () because I'm not referring to the directory the XSL/XML files are parsed in. Maybe it has something to do with my PHP version? 4.2 instead of 4.3? Thanks, Barton
Post Follow-up to this messageBarton wrote: > Hi, > > I got this problem including an XSL stylesheet (cannot open file...). > I've been Googling around, and it seems a common problem, but the > solutions don't work for me. > > This is the PHP code to parse the XSL file: > > $xh = xslt_create(); > $fileBase = 'file://var/www/html/site123/pages/xsl/'; > xslt_set_base($xh, $fileBase); > $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $args, > $params); > > This is the XSL include tag: > <xsl:include href="login_box.xsl"/> > > I'm not sure whether to use file:// or not. I guess it's for Windows > servers only and we're using Apache/Unix with PHP 4.2. But if I don't > use file://, I get another ugly error (arg not found). > > Please don't refer me to: > http://be.php.net/manual/en/function.xslt-set-base.php > > Been there, and the provided solutions don't work. I also can't use > getcwd () because I'm not referring to the directory the XSL/XML files > are parsed in. Maybe it has something to do with my PHP version? 4.2 > instead of 4.3? > > Thanks, > > Barton Found a similar problem when I was messing around with Sablotron. Instead of using file:// I just used: $result=xslt_process($xh, '/home/userid/example.xml', '/home/userid/example.xsl'); And it worked fine, shame it doesnt' like relative links, but it's only a minor annoyance. Can't comment on what windows would do though.
Post Follow-up to this messageOn Wed, 24 Mar 2004 13:37:42 +0000, "Anthony L. Plunkett" <anthony@thefort.org> wrote: >Barton wrote: > > >Found a similar problem when I was messing around with Sablotron. >Instead of using file:// I just used: > >$result=xslt_process($xh, '/home/userid/example.xml', >'/home/userid/example.xsl'); > >And it worked fine, shame it doesnt' like relative links, but it's only >a minor annoyance. Can't comment on what windows would do though. > Hi Anthony, you don't seem to understand me. The problems I got have nothing to do with arg:/_xml or arg:/_xsl. That works just fine, the parser correctly finds the XSL and XML files. Now the problem starts when using the XSL tag <include> in the XSL document that is parsed. A nice detail is that this XSL file is located in the same directory as the main XSL file which is correctly found! Grtz, Barton
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.