[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to transform xml and xsl to a php format

Subject: RE: How to transform xml and xsl to a php format
From: Sergiu Ignat <sergiu@xxxxxxxxxx>
Date: Thu, 23 Jan 2003 12:42:19 +0200
php format
Your XSL is not suitable for what you want.
Your output is not XML or HTML but plain text.
Try to use 
<xsl:output  method = "text"/> to generate textual output. And don't think
you mast use CDATA sections in your XSL.

Sergiu

> -----Original Message-----
> From: Ard Schrijvers [mailto:Ard@xxxxxxxx]
> Sent: 23 ianuarie 2003 12:00
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Cc: Arthur Bogaart
> Subject:  How to transform xml and xsl to a php format
> 
> 
> 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
> 

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.