Generate proper META tag in HTML output?
Posted: Sat Aug 15, 2015 6:36 am
------
Oxygen 17, XSLT transform with Saxon6.5.5 transformer.
I'm using a book's examples to get started with XSLT.
One of the examples is generating HTML output without a closing META tag.
■ When I open the HTML output in oXygen 17, oXygen informs me, element "title" not allowed here; expected the element end-tag.
■ If I simply use the editor to add a </meta> tag to the HTML by hand, the error is remedied.
I want to please learn the correct way to eliminate this sort of error.
The Source XML
The XSL
The HTML Output
I'm new to this so not sure what the correct way is to remedy this problem. I'm surprised that the process doesn't automatically add the </meta> tag if it's required(?)
Cheers & thanks for your help,
Riley
SFO
Oxygen 17, XSLT transform with Saxon6.5.5 transformer.
I'm using a book's examples to get started with XSLT.
One of the examples is generating HTML output without a closing META tag.
■ When I open the HTML output in oXygen 17, oXygen informs me, element "title" not allowed here; expected the element end-tag.
■ If I simply use the editor to add a </meta> tag to the HTML by hand, the error is remedied.
I want to please learn the correct way to eliminate this sort of error.
The Source XML
Code: Select all
<?xml version="1.0"?>
<message>You can use literal result elements in stylesheets.</message>
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>HTML Output</title>
</head>
<body>
<p>
<xsl:apply-templates/>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- NOTE that imply adding a </meta> closing here eliminates the error -->
<title>HTML Output</title>
</head>
<body>
<p>You can use literal result elements in stylesheets.</p>
</body>
</html>>
Cheers & thanks for your help,
Riley
SFO