XML/XSLT problem

Discussion in 'XML' started by Kavok, May 10, 2006.

  1. Kavok

    Kavok Guest

    Im using Cooktop or Saxon to combine both of these into an xml file.

    I would like the end product to be read by browsers are html, or xhtml.

    However as soon as I open up the output.xml in say IE it gives me this
    message:
    ------------------------------------------------------------------------------------------------------------------------------
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error
    and then click the Refresh button, or try again later.


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

    End tag 'head' does not match the start tag 'META'. Error processing
    resource 'file:///C:/Documents and Settings/User154/De...

    </head>
    --^
    ------------------------------------------------------------------------------------------------------------------------------


    What am I doing wrong?


    File Characters.xsl:
    ---------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

    <xsl:eek:utput method="html" />

    <xsl:template match="/">
    <html>
    <head>
    <title>TEST</title>
    </head>
    <body>
    <h3>The recorded age is unusually high. Please check original data</h3>
    <xsl:apply-templates select="/Characters/Character" />
    </body>
    </html>
    </xsl:template>

    <xsl:template match="Character">
    <xsl:if test="@age &gt; 110" >
    <p><b><xsl:value-of select="." /></b>Is older than expected. Please
    check if this character's age, <xsl:value-of select="@age" /></p>
    </xsl:if>
    </xsl:template>

    </xsl:stylesheet>
    ---------------------------------------------------------------
    File Characters.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Characters.xsl"?>
    <Characters>
    <Character age="99">Julius Caesar</Character>
    <Character age="23">Anne Boleyn</Character>
    <Character age="41">George Washington</Character>
    <Character age="45">Martin Luther</Character>
    <Character age="800">Methuselah</Character>
    <Character age="119">Moses</Character>
    <Character age="50">Asterix the Gaul</Character>
    </Characters>
    ---------------------------------------------------------------
     
    Kavok, May 10, 2006
    #1
    1. Advertising

  2. Kavok

    Peter Flynn Guest

    Kavok wrote:
    > Im using Cooktop or Saxon to combine both of these into an xml file.
    >
    > I would like the end product to be read by browsers are html, or xhtml.
    >
    > However as soon as I open up the output.xml in say IE it gives me this
    > message:
    > ------------------------------------------------------------------------------------------------------------------------------
    > The XML page cannot be displayed
    > Cannot view XML input using XSL style sheet. Please correct the error
    > and then click the Refresh button, or try again later.
    >
    >
    > --------------------------------------------------------------------------------
    >
    > End tag 'head' does not match the start tag 'META'. Error processing
    > resource 'file:///C:/Documents and Settings/User154/De...
    >
    > </head>
    > --^
    > ------------------------------------------------------------------------------------------------------------------------------
    >
    >
    > What am I doing wrong?


    Using Internet Explorer.
    It works fine in Firefox here.

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/

    >
    > File Characters.xsl:
    > ---------------------------------------------------------------
    > <?xml version="1.0" encoding="UTF-8"?>
    > <xsl:stylesheet
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > version="1.0">
    >
    > <xsl:eek:utput method="html" />
    >
    > <xsl:template match="/">
    > <html>
    > <head>
    > <title>TEST</title>
    > </head>
    > <body>
    > <h3>The recorded age is unusually high. Please check original data</h3>
    > <xsl:apply-templates select="/Characters/Character" />
    > </body>
    > </html>
    > </xsl:template>
    >
    > <xsl:template match="Character">
    > <xsl:if test="@age &gt; 110" >
    > <p><b><xsl:value-of select="." /></b>Is older than expected. Please
    > check if this character's age, <xsl:value-of select="@age" /></p>
    > </xsl:if>
    > </xsl:template>
    >
    > </xsl:stylesheet>
    > ---------------------------------------------------------------
    > File Characters.xml:
    > <?xml version="1.0" encoding="UTF-8"?>
    > <?xml-stylesheet type="text/xsl" href="Characters.xsl"?>
    > <Characters>
    > <Character age="99">Julius Caesar</Character>
    > <Character age="23">Anne Boleyn</Character>
    > <Character age="41">George Washington</Character>
    > <Character age="45">Martin Luther</Character>
    > <Character age="800">Methuselah</Character>
    > <Character age="119">Moses</Character>
    > <Character age="50">Asterix the Gaul</Character>
    > </Characters>
    > ---------------------------------------------------------------
    >
     
    Peter Flynn, May 10, 2006
    #2
    1. Advertising

  3. Kavok

    Andy Dingley Guest

    On 10 May 2006 13:08:09 -0700, "Kavok" <> wrote:

    >End tag 'head' does not match the start tag 'META'. Error processing
    >resource 'file:///C:/Documents and Settings/User154/De...


    Something (probably IE) is playing at web servers and deciding that your
    HTML needs to have a <meta> element embedded in the head. It's sticking
    a HTML-style <meta> in there, not even an XML-style <meta/> and so your
    document stops being well-formed altogether.
     
    Andy Dingley, May 10, 2006
    #3
    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. Stylus Studio
    Replies:
    0
    Views:
    764
    Stylus Studio
    Aug 3, 2004
  2. loveNUNO
    Replies:
    2
    Views:
    967
    loveNUNO
    Nov 20, 2003
  3. H. Kaya
    Replies:
    1
    Views:
    511
    Soren Kuula
    Feb 13, 2004
  4. Replies:
    4
    Views:
    713
  5. jkflens
    Replies:
    2
    Views:
    1,544
    jkflens
    May 30, 2006
Loading...

Share This Page