Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Sablotron xsl include() file not found
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

Report this thread to moderator Post Follow-up to this message
Old Post
Barton
03-27-04 04:13 AM


Re: Sablotron xsl include() file not found
Barton 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.



Report this thread to moderator Post Follow-up to this message
Old Post
Anthony L. Plunkett
03-27-04 04:13 AM


Re: Sablotron xsl include() file not found
On 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

Report this thread to moderator Post Follow-up to this message
Old Post
Barton
03-27-04 04:13 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:51 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.