I have a generated xhtml-file which starts with the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ift.tt/kkyg93">
<html xmlns="http://ift.tt/lH0Osb">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<meta name="keywords" content="Software logistics, ticket" />
</head>
<body>
...
</body>
</html>
Now, I want to add link and script tags inside the head tag and I want to add "xmlns:ui="http://ift.tt/KsEgXx" in the html tag. I am using the following xsl so far:
<xsl:stylesheet version="1.0" xmlns:xsl="http://ift.tt/tCZ8VR">
<xsl:output method="xml"
doctype-system="http://ift.tt/kkyg93"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
indent="yes" encoding="iso-8859-1"/>
<xsl:template match="/html">
<html xmlns="http://ift.tt/lH0Osb"
xmlns:ui="http://ift.tt/KsEgXx">
<xsl:apply-templates select="@*|node()"/>
</html>
</xsl:template>
<xsl:template match="/html/head">
<link rel="stylesheet" type="text/css" media="screen"
href="common/css/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="common/css/print.css" />
<script src="../../common/js/common.js" type="text/javascript"></script>
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
But it does not work. The output should be an xhtml file and I am using xsltproc to apply my xsl sheet to the xhtml input file. Neither the xmlns:ui is added nor the tags are added ... What am I doing wrong?
Thanks in advance!
No comments:
Post a Comment