zend example

D

duzy

Hi!

I have used ctrl+c, ctrl+v method with this example:

http://www.zend.com/php5/articles/php5-xmlphp.php#Heading18

and it is the result (in IE6):

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and
then click the Refresh button, or try again later.


------------------------------------------------------------------------
--------

Invalid at the top level of the document. Error processing resource
'http://duzy.dsv.agh.edu.pl/xmltry/fun.php'. Line 1, Position 22

<?xml version="1.0"?>

Whats wrong?
 
M

Martin Honnen

duzy wrote:

I have used ctrl+c, ctrl+v method with this example:

http://www.zend.com/php5/articles/php5-xmlphp.php#Heading18

and it is the result (in IE6):

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and
then click the Refresh button, or try again later.


------------------------------------------------------------------------
--------

Invalid at the top level of the document. Error processing resource
'http://duzy.dsv.agh.edu.pl/xmltry/fun.php'. Line 1, Position 22

<?xml version="1.0"?>

Whats wrong?

Hard to tell, I have tried <http://duzy.dsv.agh.edu.pl/xmltry/fun.php>
but it timed out.
What is the URL of the XML, what is the URL of the XSLT stylesheet?

And what are you trying, server-side transformation with PHP or
client-side transformation? The cited article is about PHP but the error
messages seems to indicate that client-side transformation in IE occurs.
 
D

duzy

Hard to tell, I have tried <http://duzy.dsv.agh.edu.pl/xmltry/fun.php>
but it timed out.
What is the URL of the XML, what is the URL of the XSLT stylesheet?

And what are you trying, server-side transformation with PHP or
client-side transformation? The cited article is about PHP but the error
messages seems to indicate that client-side transformation in IE occurs.

I am trying server-side transformation with PHP.
http://duzy.dsv.agh.edu.pl/xmltry/fun.php is wisible only in my local web.
XML and XSLT and php file are in the same catalog.

Duzy
 
M

Martin Honnen

duzy wrote:

I am trying server-side transformation with PHP.
http://duzy.dsv.agh.edu.pl/xmltry/fun.php is wisible only in my local web.
XML and XSLT and php file are in the same catalog.

I have had a look again and indeed the example given in
<http://www.zend.com/php5/articles/php5-xmlphp.php#Heading18> is a bit
flawed, it is supposed to output XML but doesn't create any element.

Change the XSLT stylesheet to

<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl">
<xsl:template match="today">
<xsl:copy>
<xsl:value-of select="php:function('dateLang')" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

and then all is fine in regard to the XML output that IE sees.

However if you really want the output of the PHP to be seen as XML then add
header('Content-Type: application/xml');
before the line
print $newdom->saveXML();
 
D

duzy

I have used ctrl+c, ctrl+v method with this example:I have used ctrl+c, ctrl+v method including the comments, and thats why a
had mistake :(
But it's ok now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top