I'm struggling to understand what 'exclude-result-prefixes' does and is
for; the language of the standard
http://www.zvon.org/xxl/XSLTreferenc...result-element
is not exactly easy to follow. What I assumed it was supposed to do is mark
specific prefixes as not to be printed in the generated document, but that
does not work with any of the XSL tools I'm currently working with (Xalan
1.2.2 and 2.7.0, xsltproc 1.1.19). Specifically, the following stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xhtml">
<xsl:output indent="yes" method="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="xhtml:html">
<xhtml:html><xhtml:body>Hello world!</xhtml:body></xhtml:html>
</xsl:template>
<xsl:template match="*">
<!-- nothing -->
</xsl:template>
</xsl:stylesheet>
generates
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:body>Hello world!</xhtml:body>
</xhtml:html>
from any HTML page using any current XSL processor that I have access to.
The specific reason I attacking this problem is that
(1) Older browsers barf at 'xhtml:html' and other such tagnames; and
(2) The W3C validator barfs at 'xmlns'
So, in summary, if anyone could educate me as to what
exclude-result-prefixes is really supposed to do (and why), and, as an
aside, how I can do what I thought it was meant to do, I'd be really
grateful.
--
si***@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
;; If God does not write LISP, God writes some code so similar to
;; LISP as to make no difference.