]> granicus.if.org Git - docbook-dsssl/commitdiff
docbook5-xsl => docbook-xsl-ns, etc.
authorMichael Smith <xmldoc@users.sourceforge.net>
Mon, 25 Jun 2007 05:03:22 +0000 (05:03 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Mon, 25 Jun 2007 05:03:22 +0000 (05:03 +0000)
To ease hassles for downstream packagers, we are going to be
better of naming the namespaced stylesheets "docbook-xsl-ns"
instead of tying them to a specific version of DocBook (i.e.,
DocBook 5). Anyway, the real distinction is in fact that they are
namespaced, not they they are for DocBook 5.

releasetools/db5.mk
releasetools/db5files/README
releasetools/db5files/db5.xsl
releasetools/makedb5xsl

index 96b4934fe619b5cdcdf83e2425d15caf7ec02eae..cd0d7bf01a23de28447e738c38f096743213846e 100644 (file)
@@ -1,51 +1,51 @@
 # this file is a -*- makefile -*- snippet
-# targets in this file are used to build and upload the DocBook 5
+# targets in this file are used to build and upload the namespaced
 # version of the DocBook Project XSL Stylesheets
 
 # $Id$
 
 debug:
 
-freshmeat5:
+freshmeat-ns:
 ifeq ($(SFRELID),)
        @echo "You must specify the sourceforge release identifier in SFRELID"
        exit 1
 else
-       $(XSLT) VERSION VERSION $(TMP)/fm-docbook5-$(DISTRO) sf-relid=$(SFRELID)
-       grep -v "<?xml" $(TMP)/fm-docbook5-$(DISTRO) | freshmeat-submit $(FMGO)
+       $(XSLT) VERSION VERSION $(TMP)/fm-docbook-$(DISTRO)-ns sf-relid=$(SFRELID)
+       grep -v "<?xml" $(TMP)/fm-docbook-$(DISTRO)-ns | freshmeat-submit $(FMGO)
 endif
 
-zip5: zip
+zip-ns: zip
        rm -rf $(TMP)/docbook-$(DISTRO)-$(ZIPVER)
-       rm -rf $(TMP)/docbook5-$(DISTRO)-$(ZIPVER)
-       $(RM)  $(TMP)/docbook5-$(DISTRO)-$(ZIPVER).tar.gz
-       $(RM)  $(TMP)/docbook5-$(DISTRO)-$(ZIPVER).tar.bz2
-       $(RM)  $(TMP)/docbook5-$(DISTRO)-$(ZIPVER).zip
+       rm -rf $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER)
+       $(RM)  $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER).tar.gz
+       $(RM)  $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER).tar.bz2
+       $(RM)  $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER).zip
        (cd $(TMP) && \
          unzip $(TMP)/docbook-$(DISTRO)-$(ZIPVER).zip && \
-         $(DOCBOOK_SVN)/releasetools/makedb5xsl \
+         $(DOCBOOK_SVN)/releasetools/makexslns \
          docbook-$(DISTRO)-$(ZIPVER) \
-         docbook5-$(DISTRO)-$(ZIPVER)); 
+         docbook-$(DISTRO)-ns--$(ZIPVER)); 
 
 # change branch info
-       sed -i "s/^\(.*\)<fm:Branch>XSL Stylesheets<\/fm:Branch>$$/\1<fm:Branch>v5 XSL Stylesheets<\/fm:Branch>/" \
-         $(TMP)/docbook5-$(DISTRO)-$(ZIPVER)/VERSION
+       sed -i "s/^\(.*\)<fm:Branch>XSL Stylesheets<\/fm:Branch>$$/\1<fm:Branch>XSL NS Stylesheets<\/fm:Branch>/" \
+         $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER)/VERSION
 
 # change distro name
-       sed -i "s/^\(.*\)<xsl:param name=\"DistroName\">docbook-xsl<\/xsl:param>$$/\1<xsl:param name=\"DistroName\">docbook5-xsl<\/xsl:param>/" \
-         $(TMP)/docbook5-$(DISTRO)-$(ZIPVER)/VERSION
+       sed -i "s/^\(.*\)<xsl:param name=\"DistroName\">docbook-xsl<\/xsl:param>$$/\1<xsl:param name=\"DistroName\">docbook-xsl-ns<\/xsl:param>/" \
+         $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER)/VERSION
 
 # repair perms
-       chmod 755 $(TMP)/docbook5-$(DISTRO)-$(ZIPVER)/fo/pdf2index
-       chmod 755 $(TMP)/docbook5-$(DISTRO)-$(ZIPVER)/install.sh
+       chmod 755 $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER)/fo/pdf2index
+       chmod 755 $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER)/install.sh
 
 # gzip/bzip/zip it
-       umask 022; cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook5-$(DISTRO)-$(ZIPVER) \
-       | gzip >  docbook5-$(DISTRO)-$(ZIPVER).tar.gz
-       umask 022; cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook5-$(DISTRO)-$(ZIPVER) \
-       | bzip2 > docbook5-$(DISTRO)-$(ZIPVER).tar.bz2
-       umask 022; cd $(TMP) && $(ZIP) $(ZIPFLAGS) docbook5-$(DISTRO)-$(ZIPVER).zip \
-        docbook5-$(DISTRO)-$(ZIPVER)
-
-install5: zip5 install
-       -$(FTP) $(FTP_OPTS) "mput -O $(SF_UPLOAD_DIR) $(TMP)/docbook5-$(DISTRO)-$(ZIPVER).*; quit" $(SF_UPLOAD_HOST)
+       umask 022; cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook-$(DISTRO)-ns-$(ZIPVER) \
+       | gzip >  docbook-$(DISTRO)-ns-$(ZIPVER).tar.gz
+       umask 022; cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook-$(DISTRO)-ns-$(ZIPVER) \
+       | bzip2 > docbook-$(DISTRO)-ns-$(ZIPVER).tar.bz2
+       umask 022; cd $(TMP) && $(ZIP) $(ZIPFLAGS) docbook-$(DISTRO)-ns-$(ZIPVER).zip \
+        docbook-$(DISTRO)-ns-$(ZIPVER)
+
+install-ns: zip-ns install
+       -$(FTP) $(FTP_OPTS) "mput -O $(SF_UPLOAD_DIR) $(TMP)/docbook-$(DISTRO)-ns-$(ZIPVER).*; quit" $(SF_UPLOAD_HOST)
index f74e082e98c7fee3e65110ff7f7b5b5003847d3a..3de5adbbcc9aaf28db972fe744e8d19ec220ea1a 100644 (file)
@@ -1,15 +1,17 @@
-DocBook 5 XSL stylesheets
+DocBook XSL NS (namespaced) Stylesheets
 ===========================================
 Bob Stayton
 bobs@sagehill.net
 
-This package contains a release of XSL stylesheets
-for processing DocBook 5 documents.  The stylesheets are
-the same as the concurrent stylesheet release except that
-the templates match on elements in the DocBook namespace.
+This package contains a release of XSL stylesheets for
+processing namespaced DocBook documents (DocBook 5 or
+later). The stylesheets are the same as the concurrent
+stylesheet release except that the templates match on
+elements in the DocBook namespace.
 
-Note, the stylesheets in these directories have
-not yet been converted to use the DocBook 5 namespace:
+Note, the stylesheets in the directories listed below
+have not yet been converted to use the DocBook
+namespace:
 
   slides
   website
@@ -19,25 +21,29 @@ not yet been converted to use the DocBook 5 namespace:
 Background
 -------------
 DocBook 5 differs from preceding versions of DocBook because
-its elements are in a namespace "http://docbook.org/ns/docbook".
+its elements are in a namespace, "http://docbook.org/ns/docbook".
 Because the elements are in a namespace, the regular
 DocBook XSL templates do not match on the elements.
 In XSLT, a match attribute must explicitly specify
 the namespace prefix to match an element in that namespace
 (the default namespace does not apply to pattern matches).
 
-The regular stylesheets are able to process DocBook 5
-documents now, because they preprocess a DB5 document to
-remove the namespace.  When the regular stylesheet
-detects that the root element is in the namespace, it
-processes the document with mode="stripNS" to copy all
-the nodes to a variable, but without the DocBook namespace.
+The non-namspaced DocBook XSL stylesheets (created
+originally for processing DocBook 4 and earlier documents,
+before DocBook was put into a namespace for the DocBook 5
+release) are able to process a namespaced DocBook document
+by preprocessing the document to strip the namespace.
+
+When the non-namspaced stylesheet detects that the root
+element of a document is in the DocBook namespace, it
+processes the document with mode="stripNS" to copy all the
+nodes to a variable, but without the DocBook namespace.
 Then it converts the variable to a nodeset, and processes
 the nodeset with the regular templates.
 
 The alternative approach is to create a set of templates
-that match on the native namespace of DocBook 5 documents.
-These stylesheets do that.
+that match on the native namespace of DocBook 5 and
+later documents.  These stylesheets do that.
 
 These stylesheets completely mimic the behavior of the
 existing stylesheets.  These are not XSLT 2.0 stylesheets,
@@ -88,22 +94,24 @@ now recognize DocBook 5 elements in their native namespace.
 
 How to use these stylesheets
 --------------------------------
-A DocBook 5 document has the DocBook namespace declaration
-in the root element, along with the version attribute:
+DocBook 5 and later documents hav the DocBook namespace
+declaration in the root element, along with the version
+attribute:
 
   <book xslns="http://docbook.org/ns/docbook" version="5.0">
 
-You can process a DocBook 5 document with these stylesheets
-using any XSLT processor, including xsltproc, Saxon 6 or 8,
-and Xalan.  Use these stylesheets as you would a stylesheet
-from the regular distribution (except for slides, website,
-and roundtrip).
+You can process a namespaced DocBook document with these
+stylesheets using any XSLT processor, including xsltproc,
+Saxon 6 or 8, and Xalan.  Use these stylesheets as you would
+a stylesheet from the regular distribution (except for
+slides, website, and roundtrip).
 
 If you happen to process a DocBook document whose root element
 is without the namespace declaration, the stylesheet
 does not fail.  Rather, it detects that the document
 does not have the namespace, and preprocesses it to add the
 namespace declaration to all elements in the document.
+
 In a manner similar to stripNS, it copies the elements
 to a variable while adding the namespace, converts the
 variable to a nodeset, and then processes the nodeset with
@@ -156,4 +164,3 @@ Report any problems
 These are new stylesheets and need thorough testing.
 Please report any problems to the docbook-apps
 mailing list or the SourceForge bug tracker.
-
index aee3795bd8d4e12ce6e28ee669705f9c6600bcf4..ef85656150fe42ffb5b3dc3628a5178c47994890 100644 (file)
@@ -11,7 +11,7 @@
 
 <xsl:import href="../common/common.xsl"/>
 
-<!-- Template to add the namespace to non-db5 documents -->
+<!-- Template to add the namespace to non-namespaced documents -->
 <xsl:template match="*" mode="addNS">
   <xsl:element name="{local-name()}" 
           namespace="http://docbook.org/ns/docbook">
index da82a8dbe5151354a5a7542c88dd38ca170f7b58..c426b87441881869ee162eab1b06b2a18fc6cc21 100755 (executable)
@@ -253,7 +253,7 @@ sub nsfilter {
   s|(xmlns:xsl\s*=\s*"http://www.w3.org/1999/XSL/Transform"(?!>))(\s*\n?)(\s*)|$1$2$3xmlns:d="http://docbook.org/ns/docbook"\n$3|s;
   
   # Convert stripNS to addNS
-  s|href="../common/stripns.xsl"|href="../common/db5.xsl"|sg;
+  s|href="../common/stripns.xsl"|href="../common/addns.xsl"|sg;
   
   s|(\s*\n*)(\s*)(<xslo?:when)\s+test\s*=\s*"[^"]*?self::db:[^"]*?">.*?(</xslo?:when>)|$1$2$3 test="namespace-uri\(\*\[1\]\) != 'http://docbook.org/ns/docbook'">\n$2 <xsl:variable name="doc.title">\n$2 <xsl:call-template name="get.doc.title"/>\n$2 </xsl:variable>\n$2 <xsl:call-template name="log.message">\n$2 <xsl:with-param name="level">Note</xsl:with-param>\n$2 <xsl:with-param name="source" select="\$doc.title"/>\n$2 <xsl:with-param name="context-desc">\n$2 <xsl:text>namesp. add</xsl:text>\n$2 </xsl:with-param>\n$2 <xsl:with-param name="message">\n$2 <xsl:text>added namespace before processing</xsl:text>\n$2 </xsl:with-param>\n$2 </xsl:call-template>\n$2 <xsl:variable name="addns">\n$2    <xsl:apply-templates mode="addNS"/>\n$2  </xsl:variable>\n$2  <xsl:apply-templates select="exsl:node-set\(\$addns\)"/>\n$2$4|sg;
   
@@ -468,15 +468,15 @@ sub namespacefilter {
 # 
 sub addFiles {
   my $miscdir = dirname $0;
-  $miscdir .= '/db5files';
+  $miscdir .= '/xslnsfiles';
   print STDOUT "miscdir is $miscdir" . "\n";
-  copy("$miscdir/db5.xsl", "$destdir/common");
+  copy("$miscdir/addns.xsl", "$destdir/common");
   copy("$miscdir/README", "$destdir/README");
   copy("$miscdir/manpages.table.xsl", "$destdir/manpages/table.xsl");
   copy("$miscdir/titlepage.xsl", "$destdir/template/titlepage.xsl");
 
   # delete these obsolete files.
 
-  # Replace stripns.xsl with db5.xsl in profiling module
+  # Replace stripns.xsl with addns.xsl in profiling module
   &nsfilter("$srcdir/profiling/profile.xsl", "$destdir/profiling/profile.xsl");
 }