473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 2770
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.