Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML/XSLT problem

Reply
Thread Tools

XML/XSLT problem

 
 
Kavok
Guest
Posts: n/a
 
      05-10-2006
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
xmlnssl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

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

 
Reply With Quote
 
 
 
 
Peter Flynn
Guest
Posts: n/a
 
      05-10-2006
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
> xmlnssl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xslutput 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>
> ---------------------------------------------------------------
>

 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      05-10-2006
On 10 May 2006 13:08:09 -0700, "Kavok" <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments