zend example

Discussion in 'XML' started by duzy, Mar 5, 2005.

  1. duzy

    duzy Guest

    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?
     
    duzy, Mar 5, 2005
    #1
    1. Advertising

  2. 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.




    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 5, 2005
    #2
    1. Advertising

  3. duzy

    duzy Guest

    >
    > > 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.
    >


    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
     
    duzy, Mar 5, 2005
    #3
  4. 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();

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 5, 2005
    #4
  5. duzy

    duzy Guest

    > > 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.
     
    duzy, Mar 5, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bright
    Replies:
    1
    Views:
    545
  2. Timo Dammes
    Replies:
    2
    Views:
    6,525
    Elliot Schei
    Jun 11, 2004
  3. bob

    Shift register example?

    bob, Feb 18, 2005, in forum: VHDL
    Replies:
    1
    Views:
    3,259
    Ralf Hildebrandt
    Feb 18, 2005
  4. Skybuck Flying

    Question about 2 bit counter example.

    Skybuck Flying, Aug 2, 2005, in forum: VHDL
    Replies:
    3
    Views:
    7,150
    Ralf Hildebrandt
    Aug 3, 2005
  5. Sam Roberts
    Replies:
    15
    Views:
    303
    Sam Roberts
    Feb 7, 2005
Loading...

Share This Page