[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
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 : >? if(!auth()){ > > header("Location: /Home/index.html"); > exit; > ........ > etc..... > > ?< > 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|