
September 6th, 2005, 06:33 PM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 22,309
Time spent in forums: < 1 sec
Reputation Power: 24
|
|
|
client side xml->xhtml via xsl
I want to generate xml that will be transformed to xhtml when picked up by a browser. But I don't want to do it server side b/c that would take proc time and I would lose the ability to view the xml.
I wrote a php that puts out xml headed with
<?php
echo "
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='./as.xslt'?>";
...
but when I serve it I always get an error.
Invalid at the top level of the document. Error processing resource 'file:///C:/Documents and Settings/me/My Documen...
<?xml-stylesheet type='text/xsl' href='./as.xslt'?>";
---------------------------------------------------^
Thinking my xml was wrong, I copied the text ouput to a file called test.xml and it worked! Why does it work when I put to output in a file but not when I serve the file directly?
Very confusing.
This would make a good tutorial if you have the time.
Many Thanks.
|