1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3		xmlns:ng="http://docbook.org/docbook-ng"
4		xmlns:db="http://docbook.org/ns/docbook"
5                xmlns:exsl="http://exslt.org/common"
6                exclude-result-prefixes="db ng exsl"
7                version='1.0'>
8
9<xsl:import href="docbook.xsl"/>
10
11<xsl:output method="xml" encoding="utf-8" indent="no"/>
12
13<xsl:template match="/">
14  <xsl:choose>
15    <xsl:when test="function-available('exsl:node-set')
16		    and (*/self::ng:* or */self::db:*)">
17      <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
18	   toss the namespace and continue. Someday we'll reverse this logic
19	   and add the namespace to documents that don't have one.
20	   But not before the whole stylesheet has been converted to use
21	   namespaces. i.e., don't hold your breath -->
22      <xsl:message>Stripping NS from DocBook 5/NG document.</xsl:message>
23      <xsl:apply-templates mode="stripNS"/>
24    </xsl:when>
25    <xsl:otherwise>
26      <xsl:message terminate="yes">
27	<xsl:text>Cannot strip without exsl:node-set.</xsl:text>
28      </xsl:message>
29    </xsl:otherwise>
30  </xsl:choose>
31</xsl:template>
32
33</xsl:stylesheet>
34