]> granicus.if.org Git - docbook-dsssl/commitdiff
Adding yet another hack to workaround the fact that the DocBook 5
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 17 Jul 2007 05:07:10 +0000 (05:07 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 17 Jul 2007 05:07:10 +0000 (05:07 +0000)
grammar requires @xml:id instead of @id, and xsltproc actually
takes xml:id seriously and checks that it's really a NCName.

xsl/tools/xsl/build/id-to-xmlid.xsl [new file with mode: 0644]

diff --git a/xsl/tools/xsl/build/id-to-xmlid.xsl b/xsl/tools/xsl/build/id-to-xmlid.xsl
new file mode 100644 (file)
index 0000000..dd8aaaf
--- /dev/null
@@ -0,0 +1,20 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version='1.0'
+  xmlns:fo="http://www.w3.org/1999/XSL/Format"
+  xmlns:saxon="http://icl.com/saxon"
+  exclude-result-prefixes="fo"
+  >
+  <xsl:import href="./identity.xsl"/>
+
+  <xsl:output method="xml"
+    encoding="ASCII"
+    saxon:character-representation="decimal"
+    indent="no"/>
+
+  <xsl:template match="@id">
+    <xsl:attribute name="xml:id">
+      <xsl:value-of select="."/>
+    </xsl:attribute>
+  </xsl:template>
+
+</xsl:stylesheet>