From 282cee24fbcd294c4262321651c0da7bf57f2c72 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 18 Oct 2013 20:39:25 +0000 Subject: [PATCH] Remove autoguessing of the namespace for wrapper elements; determine namespace by prefix, if any. --- xsl/fo/titlepage.templates.xml | 5 +- xsl/html/titlepage.templates.xml | 3 +- xsl/slides/fo/plain-titlepage.xml | 4 +- xsl/slides/xhtml/plain-titlepage.xml | 5 +- xsl/template/titlepage.xsl | 529 ++++++++++++++---------- xsl/webhelp/xsl/titlepage.templates.xml | 3 +- 6 files changed, 314 insertions(+), 235 deletions(-) diff --git a/xsl/fo/titlepage.templates.xml b/xsl/fo/titlepage.templates.xml index a8a096008..250780b4f 100644 --- a/xsl/fo/titlepage.templates.xml +++ b/xsl/fo/titlepage.templates.xml @@ -13,9 +13,10 @@ ]> + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + t:copy-namespaces="fo"> diff --git a/xsl/slides/fo/plain-titlepage.xml b/xsl/slides/fo/plain-titlepage.xml index d817f130c..ed66128a2 100644 --- a/xsl/slides/fo/plain-titlepage.xml +++ b/xsl/slides/fo/plain-titlepage.xml @@ -14,8 +14,10 @@ ]> + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + t:copy-namespaces="dbs fo"> diff --git a/xsl/slides/xhtml/plain-titlepage.xml b/xsl/slides/xhtml/plain-titlepage.xml index fb6569d7b..cd122729f 100644 --- a/xsl/slides/xhtml/plain-titlepage.xml +++ b/xsl/slides/xhtml/plain-titlepage.xml @@ -1,6 +1,9 @@ + xmlns:dbs="http://docbook.org/ns/docbook-slides" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + t:copy-namespaces="dbs"> diff --git a/xsl/template/titlepage.xsl b/xsl/template/titlepage.xsl index 857f2fc5d..b1ef3e1c7 100644 --- a/xsl/template/titlepage.xsl +++ b/xsl/template/titlepage.xsl @@ -20,15 +20,6 @@ - - - - - http://www.w3.org/1999/XSL/Format - http://www.w3.org/1999/xhtml - - - @@ -60,6 +51,102 @@ + + +Obtain namespace prefix for an element identified by a string containing qualified name + +This template interprets a string containing a qualified name of an element +and returns the namespace prefix, if any. +Element name could be an XPath expression starting with the element name; this +template will first determine if the occurrence of a colon is preceded by a valid +NCName, assuming only ASCII characters. + + + + + + + + + + + + +Obtain URI for an element identified by a string containing qualified name + +This template interprets a string containing a qualified name of an element +and returns the namespace URI for that element, looking for namespace prefixes +starting from a reference node. + + + + + + + + + + + + + + + + + + + + + WARNING: Namespace ' + + ' not defined for t:element=" + + "; if this is intentional (output has is not in a namespace), add + t:missing-namespace-ok="yes" attribute to t:templates to suppress this warning. + + + + + + +Output the wrapper element + + +This template locates the namespace for the defined wrapper element +and output it within that namespace. The content of the element is passed +via the content argument. +The attribute sets to use for the wrapper element and the element to +copy non-template attributes from are also passed as arguments. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Construct a stylesheet for the templates provided @@ -72,6 +159,11 @@ set of templates. This template creates an appropriate If the t:templates element has a base-stylesheet attribute, an xsl:import statement is constructed for it. + +If the t:templates element has a +copy-namespaces attribute, it is interpreted as a +space-separated list of namespace prefixes to be copied from the template +to the resulting stylesheet. Default namespace is always copied. @@ -82,6 +174,14 @@ set of templates. This template creates an appropriate + + + + + + + + 1.0 exsl @@ -187,139 +287,142 @@ and verso sides of the title page. .titlepage - - - - - recto.content - - - - - .titlepage.before.recto - + + + + + recto.content + + + + + .titlepage.before.recto + + + + + + + .titlepage.recto + + + - - - - - .titlepage.recto - + + + recto.elements.count + + + + + function-available('exsl:node-set') + + count(exsl:node-set($recto.content)/*) + + + + + contains(system-property('xsl:vendor'), 'Apache Software Foundation') + + Xalan quirk + + count(exsl:node-set($recto.content)/*) + + + + + 1 + + + + - - - - recto.elements.count - - - - - function-available('exsl:node-set') - - count(exsl:node-set($recto.content)/*) - - - - - contains(system-property('xsl:vendor'), 'Apache Software Foundation') - - Xalan quirk - - count(exsl:node-set($recto.content)/*) - - - - - 1 - - - - - - - - (normalize-space($recto.content) != '') or ($recto.elements.count > 0) - - - - - $recto.content + + (normalize-space($recto.content) != '') or ($recto.elements.count > 0) + + + + + + $recto.content + + + + + + + + verso.content + + + + + .titlepage.before.verso + + + + + + .titlepage.verso + + + - - - - verso.content - - - - - .titlepage.before.verso - + + verso.elements.count + + + + + function-available('exsl:node-set') + + count(exsl:node-set($verso.content)/*) + + + + + contains(system-property('xsl:vendor'), 'Apache Software Foundation') + + Xalan quirk + + count(exsl:node-set($verso.content)/*) + + + + + 1 + + + + + + + + (normalize-space($verso.content) != '') or ($verso.elements.count > 0) + + + + + + $verso.content + + + + - + - .titlepage.verso + .titlepage.separator - - - - - verso.elements.count - - - - - function-available('exsl:node-set') - - count(exsl:node-set($verso.content)/*) - - - - - contains(system-property('xsl:vendor'), 'Apache Software Foundation') - - Xalan quirk - - count(exsl:node-set($verso.content)/*) - - - - - 1 - - - - - - - - (normalize-space($verso.content) != '') or ($verso.elements.count > 0) - - - - - $verso.content - - - - - - - - - .titlepage.separator - - - - + + + @@ -391,86 +494,60 @@ and verso sides of the title page. .auto.mode - - + + .titlepage. .style - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - . - - - .titlepage. - - .mode - - - - + + + + + + + + + + + + + + + + + + + + + + + + + . + + + .titlepage. + + .mode + + + + - - + + + - -Copy t:titlepage attributes - - -This template copies all of the other attributes -from a t:titlepage element onto the specified -wrapper. - - - - - - - - - - - @@ -914,42 +991,36 @@ names. - - + + .titlepage. .style - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/webhelp/xsl/titlepage.templates.xml b/xsl/webhelp/xsl/titlepage.templates.xml index c24642938..685cb63a6 100644 --- a/xsl/webhelp/xsl/titlepage.templates.xml +++ b/xsl/webhelp/xsl/titlepage.templates.xml @@ -1,6 +1,7 @@ + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + t:missing-namespace-ok="yes"> -- 2.40.0