472,958 Members | 2,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Sablotron

this (my) script i's ok:
<?php
$processor=xslt_create();
$result=xslt_process($processor,'xsl/curriculum.xml','xsl/curriculum.xsl');
if (!$result) {
echo xslt_error($processor);
}
else {echo $result;}

xslt_free($processor);
?>
...where files are under c:\PHP directory!

but this don't work:
<?php
$processor=xslt_create();
$path=dirname(__FILE__);
$tree="{$path}/xml/curriculum.xml";
$transform="{$path}/xml/curriculum.xsl";
$result=xslt_process($processor,$tree,$transform);
if (!$result) {
echo xslt_error($processor);
}
else {echo $result;}

xslt_free($processor);
?>
....where files are under the directory where is the script
...and the output is:

Warning: Sablotron error on line 1: XML parser error 4: not well-formed
(invalid token) in D:\siti\prove\3_XML\php\curriculum-sablotron.php
on line 17 (--> $result=xslt_process($processor,$tree,$transform); )

XML parser error 4: not well-formed (invalid token)

where's the problem?
why Sablotron takes files only from the directory of PHP?

thank you!

Simone

Jul 17 '05 #1
4 2753
Simone wrote:
this (my) script i's ok:
<?php
$processor=xslt_create();
$result=xslt_process($processor,'xsl/curriculum.xml','xsl/curriculum.xsl'); if (!$result) {
echo xslt_error($processor);
}
else {echo $result;}

xslt_free($processor);
?>
..where files are under c:\PHP directory!

but this don't work:
<?php
$processor=xslt_create();
$path=dirname(__FILE__);
$tree="{$path}/xml/curriculum.xml";

Why the {$path} ?
I've not seen that before, how about just putting "$path/xml..." ?

Kind Regards,

--
Ian P. Christian
Jul 17 '05 #2
>
Why the {$path} ?


with '{' and '}' you can put a variable into a quoted string!

look and try this example (PHP don't undersand wath's your variables):
<?php
$myname="simone";
echo "$mynameis my name <br>";
echo "$myname is my name <br>";
?>
....and
<?php
$myname="simone";
echo "{$myname}is my name <br>";
?>
infact in this way:
<?php
$processor=xslt_create();
$tree=dirname(__FILE__)."/xml/curriculum.xml";
$transform=dirname(__FILE__)."/xml/curriculum.xsl";
$result=xslt_process($processor,$tree,$transform);
if (!$result) {
echo xslt_error($processor);
}
else {echo $result;}

xslt_free($processor);
?>
Sablotron don't work !

Simone


Jul 17 '05 #3
With total disregard for any kind of safety measures "Simone"
<si*****************@libero.it> leapt forth and uttered:
with '{' and '}' you can put a variable into a quoted string!


But you can do that with double-quoted strings anyway....

--
There is no signature.....
Jul 17 '05 #4
Phil Roberts wrote:
With total disregard for any kind of safety measures "Simone"
<si*****************@libero.it> leapt forth and uttered:
with '{' and '}' you can put a variable into a quoted string!


But you can do that with double-quoted strings anyway....


I Was being rather blonde when I questioned this one ;)

$string = 'moo';
echo "this is a $string"; // will work
echo "this is a $stringwith text right after it"; // won't work
echo "this is a {$string}with text right after it"; // will work

Kind Regards,
--
Ian P. Christian
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Ghislain Benrais | last post by:
Hello, My "problem" : install php's XSLT API. 1)I installed Sablotron (with the rpm) : ok 2) I read every where that the next step was to compile php with option --with-xslt-sablot. Since I have...
1
by: Christos Margetis | last post by:
We are trying to implement a XSL feed of a big PPC provider in our PHP interface which is working with xsl & XML feeds over Sablotron. An engineer with knowledge on Sablotron would be...
0
by: Martin Burkert | last post by:
hello everyone, i'm generating HTML output with a PHP-Script using the xslt-functions from the php_xslt-extension and an XML / XSLT - File. Some system-infos: PHP 4.3.4 Apache/1.3.20...
0
by: Steve Jenkins | last post by:
Hi all, I'm trying to install Sablotron on Red Hat Linux release 7.2 (Enigma). I've got Sablotron to compile. I now get the following error when running ./configure on PHP: checking for...
0
by: Jim Patterson | last post by:
I am trying to compile php with sablotron and I get this error message ===================================================================== FAILED TEST SUMMARY...
1
by: krigare | last post by:
Everything compiles. Can run sabcmd with no problems. But when running a simple php script, it cannot find the sablotron functions. So it does not appear to be linking the Sablotron stuff....
0
by: Sebastian Langer | last post by:
Hi! I am looking for a Sablotron C++ API - tutorial that explains sablotron and how to use SDOM functions. The GingerAll Sablotron Reference does not help me too much. Thank you, Sebastian
9
by: Martin Plantec | last post by:
Hello, I have managed (with your help!) to make a working XSLT stylesheet; it works fine locally (Windows Apache + PHP with Sablotron 1.0), but it fails on the remote host (FreeBSD Apache + PHP...
4
by: gouranga | last post by:
Sablotron keeps giving an error (non-XSL instruction) on the line with this code: <xsl:result-document href="slideshow/index.html" format="html"> Is this implemented in Sablotron? It's quite...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.