473,396 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XML/XSLT problem

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:output 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>
---------------------------------------------------------------

May 10 '06 #1
3 1293
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:output 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>
---------------------------------------------------------------

May 10 '06 #2
On 10 May 2006 13:08:09 -0700, "Kavok" <cj*******@gmail.com> 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.
May 10 '06 #3
transforms just fine for me in IE and Firefox.
May 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ola Natvig | last post by:
Hi all I'm working with a long running, threaded server which serves HTTP requests with content which are passed through a XSLT processor. The XSLT processor I'm using is the Pyana processor. ...
6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
6
by: Ramon M. Felciano | last post by:
Helo all -- I'm trying to gain a deeper understand for what type of semi-declarative programming can be done through XML and XPath/XSLT. I'm looking at graph processing problems as a testbed for...
0
by: Mike | last post by:
I'm generating an XSLT document programatically in VB.Net. I'm then trying to apply that XSLT against a cXML document to generate my own internally developed XML document. I'm using RichTextBox...
4
by: Moogy | last post by:
I'm pulling my hair out here. First, I'm new to XML, so that doesn't help, but none of this makes any sense to me. All I'm trying to do is take a simple source XML file and translate it with an...
2
by: chris | last post by:
Hi there, I create an XML file from a dataset like this: System.IO.StreamWriter xmlSW = new System.IO.StreamWriter(FILENAME); dsUserData1.WriteXml(xmlSW, XmlWriteMode.WriteSchema);...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
3
by: thomas.porschberg | last post by:
Hi, I want to read records from a database and export it in an arbitrary format. My idea was to feed a class with a String array fetched from the database and let this class fire SAX events as...
3
by: RC | last post by:
Let's say: if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { // Now I got an XML object here var xmlDocument = XMLHttpRequestObject.responseXML; // next I have...
0
by: ManWithNoName | last post by:
The following question is related to this thread: XSLT, document() function, filename, read non-standard/English characters (like µ) I have a XML file with a non-English character in its name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.