[PHP] XSLT Sablotron output

2002-11-02 Thread Daniele Baroncelli
Hi guys,

I have typed a simple script to test the Sablotron module recently
installed.
I found out that the HTML is output all in one line, without newlines, which
is very annoying.
Anyone can tell me if this is a bug of the module, or I have to specify
something somewhere?

Here is the script on the server, where you can watch the result:
http://www.rockit.it/redazione/sixth/prova.php

Below you can find my PHP, XML and XSL files.


Cheers

Daniele


==

PHP file
--


?php

// Allocate a new XSLT processor
$xh = xslt_create();

// call the XSLT processor directly
xslt_process($xh, 'prova.xml', 'prova.xsl', 'prova.html');

// output the result
readfile('prova.html');

xslt_free($xh);

?

==

XML file
---

?xml version=1.0?
me
 nameJohn Doe/name
 address94, Main Street, Nowheresville 16463, XY/address
 tel738 2838/tel
 email[EMAIL PROTECTED]/email
 urlhttp://www.unknown_and_unsung.com//url
/me

===

XSL file
-

?xml version=1.0?

xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

xsl:template match=/

 html
 head
 /head
 body
 h1Contact information for bxsl:value-of select=me/name //b/h1

 h2Mailing address:/h2
 xsl:value-of select=me/address /

 h2Phone:/h2
 xsl:value-of select=me/tel /

 h2Email address:/h2
 xsl:value-of select=me/email /

 h2Web site URL:/h2
 xsl:value-of select=me/url /

 /body
 /html

/xsl:template

/xsl:stylesheet

==



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] XSLT - Sablotron

2002-09-05 Thread Devin Atencio

 
I am trying to find out a way I can pass a variable that is basically
an XML document to xslt_process and make it all work. My script
works if I have:
 
 
$xp = xslt_create();
$result = xslt_process($xp, 'test.xml', 'test.xsl');
 
however, if I try to do:
 
 
$xp = xslt_create();
$result = xslt_process($xp, $xmldata, 'test.xsl');
 
it won't work. $xmldata contains an XML document, but for some reason
it errors out on me, any ideas on how to make this work? I basically
have
the XML data generated dynamically from a database and then I want to 
pass it to the XSLT to process the page.
 
Any help would greatly be appreciated.
 



Re: [PHP] XSLT - Sablotron

2002-09-05 Thread Chris Wesley

On Thu, 5 Sep 2002, Devin Atencio wrote:

 I am trying to find out a way I can pass a variable that is basically
 an XML document to xslt_process and make it all work. My script

$xmldata = a whole boatload of well-formed XML;
$xsltArgs = array( '/_xml' = $xmlStr );
$xp = xslt_create();
$result = xslt_process( $xp, 'arg:/_xml', 'file.xsl', NULL, $xsltArgs );

Don't waste the code/resources on putting the xml into a file.

g.luck,
~Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php