xsl-list
[Top] [All Lists]

How to transform xml and xsl to a php format

2003-01-23 02:59:38
I am serializing my xml input with an xsl , and want to get an output like:

<?              
if(!auth()){
        header("Location: /Home/index.html"); 
        exit; 
}
function auth(){  
        $valid = false;
        session_start();  
        if (!isset($_SESSION['valid'])) {
        $valid = false;
        } else {
            $valid = $_SESSION['valid'];
        }
    return      $valid;
}  
?>

<html>
        <head>
                etc.............

So, at the beginning , I want to have <? ... some code ?>

I tried it in various way, ending up with essentially the same problem:
When i try it , like for example below:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:hc="http://www.hippo.nl/xml/hippocontent"; 
xmlns:xhive="http://hippo.nl/xhive/1.0"; 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
xmlns:res="http://www.hippo.nl/xml/resource"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml";>
        <xsl:param name="current"/>
        <xsl:param name="php"/>
        <xsl:template match="/">
                <xsl:if test="$php = 'true'">
<![CDATA[
<?              
if(!auth()){
        header("Location: /Home/index.html"); 
        exit; 
}
function auth(){  
        $valid = false;
        session_start();  
        if (!isset($_SESSION['valid'])) {
        $valid = false;
        } else {
            $valid = $_SESSION['valid'];
        }
    return      $valid;
}  
?>
]]> 



                </xsl:if>
                <html xmlns="http://www.w3.org/1999/xhtml";>
                        <xsl:comment>  ETC................................

The output generated, will look like : &gt;? if(!auth()){
                                                                                
                header("Location: /Home/index.html"); 
                                        exit; 
                                        ........
                                        etc.....

                                        ?&lt;
        and then the html code. I am not able to get the output like: <? 
......... ?>. 

Is there anybody who knows how to do this??? 

kind regards,

Ard Schrijvers

------------------------------------------------------
Professional Services Department
Hippo Webworks
Grasweg 35
1031 HW Amsterdam
The Netherlands
Tel:    0031-(0)20-6345173
Fax:   0031-(0)20-6345179
http://www.hippo.nl
------------------------------------------------------



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>