Hi all,
The snippet below is an extract of a stylesheet which transforms a DITA
map and it's topics into a xhtml page. I stripped off most of the
stylesheet and left in the template responsible for transforming a
p-topic title into a xhtml <h4>.
However... I tried to validate the generated xhtml page and somehow the
snippet below gets generated....
<h4 xmlns="">4. Marking</h4>
Can someone explain what could be causing Saxon to add an empty
namespace attribute to the <h4> tag?? I'm using Saxon 8.7.
Kind regards,
Robby Pelssers
------------------------------------------------------------------------
---------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Robby Pelssers
This stylesheet transforms the generated DITA map/topics into 1 single
xhtml page
-->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs">
<xsl:param name="contextPath"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html;charset=UTF-8" />
<title>Datasheet <xsl:value-of select="Datasheet/@id"/>
preview SPIDER</title>
<link type="text/css" rel="stylesheet"
href="resource/external/css/styles.css"/>
</head>
<body class="yui-skin-sam">
<div class="preview">
<h2 class="p-application-title"><xsl:value-of
select="Datasheet/@id"/></h2>
<xsl:apply-templates select="Datasheet/map"/>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="p-topic/title">
<xsl:variable name="numberOfPrecidingTopics"
select="count(parent::p-topic/preceding-sibling::p-topic)"/>
<h4><xsl:value-of select="concat($numberOfPrecidingTopics + 1, '.
', .)"/></h4>
</xsl:template>
<!-- copy all nodes and attributes which are not processed by one of
available templates -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
------------------------------------------------------------------------
---------------
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--