From d5a6d759ec1307538d30e2526ee70c4f4c6778b8 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 20 Jul 2007 15:35:24 +0000 Subject: [PATCH] Moved charmap templates out of lib.xweb and into common/charmap.xsl, and added charmap doc to doc build. --- xsl/common/charmap.xsl | 222 +++++++++++++++++++++++++++++++++++++++ xsl/docsrc/Makefile | 2 +- xsl/docsrc/reference.xml | 1 + xsl/lib/lib.xweb | 169 +---------------------------- 4 files changed, 226 insertions(+), 168 deletions(-) create mode 100644 xsl/common/charmap.xsl diff --git a/xsl/common/charmap.xsl b/xsl/common/charmap.xsl new file mode 100644 index 000000000..fad323aa5 --- /dev/null +++ b/xsl/common/charmap.xsl @@ -0,0 +1,222 @@ + + + + + + + Common » Character-Map Template Reference + + $Id: utility.xsl 7056 2007-07-17 13:56:09Z xmldoc $ + + + + + Introduction + This is technical reference documentation for the + character-map templates in the DocBook XSL Stylesheets. + + These templates are defined in a separate file from the set + of “common” templates because some of the common templates + reference DocBook XSL stylesheet parameters, requiring the + entire set of parameters to be imported/included in any + stylesheet that imports/includes the common templates. + The character-map templates don’t import or include + any DocBook XSL stylesheet parameters, so the + character-map templates can be used without importing the + whole set of parameters. + + This is not intended to be user documentation. It is + provided for developers writing customization layers for the + stylesheets. + + + + + + Applies an XSLT character map + + This template applies an XSLT character map; that is, it causes certain + individual characters to be substituted with strings of one + or more characters. It is useful mainly for replacing + multiple “special” characters or symbols in the same target + content. It uses the value of + map.contents to do substitution on + content, and then returns the + modified contents. + + This template is a very slightly modified version of + Jeni Tennison’s replace_strings + template in the multiple string replacements section of Dave + >Pawson’s + XSLT FAQ. + The apply-string-subst-map + template is essentially the same template as the + apply-character-map template; the + only difference is that in the map that + apply-string-subst-map expects, oldstring and newstring attributes are used + instead of character and string attributes. + + + + + content + + The content on which to perform the character-map + substitution. + + + map.contents + + A node set of elements, with each element having + the following attributes: + + + character, a + character to be replaced + + + string, a + string with which to replace character + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads in all or part of an XSLT character map + + The XSLT 2.0 specification describes character maps and explains how they may be used + to allow a specific character appearing in a text or + attribute node in a final result tree to be substituted by + a specified string of characters during serialization. The + read-character-map template provides a + means for reading and using character maps with XSLT + 1.0-based tools. + This template reads the character-map contents from + uri (in full or in part, depending on + the value of the use.subset + parameter), then passes those contents to the + apply-character-map template, along with + content, the data on which to perform + the character substitution. + Using the character map “in part” means that it uses only + those output-character elements that match the + XPath expression given in the value of the + subset.profile parameter. The current + implementation of that capability here relies on the + evaluate extension XSLT function. + + + + use.subset + + Specifies whether to use a subset of the character + map instead of the whole map; boolean + 0 or 1 + + + subset.profile + + XPath expression that specifies what subset of the + character map to use + + + uri + + URI for a character map + + + + + + + + + + + + + + + + + + + + + + + +Error: To process character-map subsets, you must use an XSLT engine +that supports the evaluate() XSLT extension function. Your XSLT engine +does not support it. + + + + + + + + + + + + diff --git a/xsl/docsrc/Makefile b/xsl/docsrc/Makefile index 0c68ec89e..22cf9511a 100644 --- a/xsl/docsrc/Makefile +++ b/xsl/docsrc/Makefile @@ -7,7 +7,7 @@ PI_DIRS=html fo common PARAM_XML_FILES=$(foreach format,$(PARAM_DIRS),../$(format)/param.xml) PI_XML_FILES=$(foreach format,$(PI_DIRS),../$(format)/pi.xml) -OTHER_XML_FILES=../common/common.xml ../common/utility.xml ../common/refentry.xml ../template/titlepage.xml ../fo/table.xml +OTHER_XML_FILES=../common/common.xml ../common/utility.xml ../common/refentry.xml ../common/charmap.xml ../template/titlepage.xml ../fo/table.xml DOCBOOK_RNG=$(DOCBOOK_SVN)/releasetools/docbook.rng PARAM_XSL_FILES=$(foreach format,$(PARAM_DIRS),../$(format)/param.xsl) diff --git a/xsl/docsrc/reference.xml b/xsl/docsrc/reference.xml index 0936d1354..f7a09ab48 100644 --- a/xsl/docsrc/reference.xml +++ b/xsl/docsrc/reference.xml @@ -199,6 +199,7 @@ + diff --git a/xsl/lib/lib.xweb b/xsl/lib/lib.xweb index 40f25f4b8..baddeaf68 100644 --- a/xsl/lib/lib.xweb +++ b/xsl/lib/lib.xweb @@ -810,10 +810,8 @@ and preserving the delimiters as text nodes between the tokens. apply-string-subst-map Apply a string-substitution map - Description - - This function applies a "string substitution" map. Use it when + This function applies a “string substitution” map. Use it when you want to do multiple string substitutions on the same target content. It reads in two things: content, the content on which to perform the substitution, and @@ -833,16 +831,14 @@ and preserving the delimiters as text nodes between the tokens. The function uses map.contents to do substitution on content, and then returns the modified contents. - This function is a very slightly modified version of Jeni - Tennison's replace_strings function in the + Tennison’s replace_strings function in the multiple string replacements section of Dave Pawson’s XSLT FAQ. - The apply-string-subst-map function is essentially the same function as the apply-character-map function; the only @@ -853,7 +849,6 @@ and preserving the delimiters as text nodes between the tokens. character and string attributes. - @@ -880,167 +875,9 @@ and preserving the delimiters as text nodes between the tokens. - - - - - - - - - - apply-character-map - Apply an XSLT character map - - - Description - - This function applies an XSLT character - map; that is, it cause certain individual characters to be - substituted with strings of one or more characters. It is useful - mainly for replacing multiple "special" characters or symbols in - the same target content. It reads in two things: - content, the content on which to perform the - substitution, and map.contents, a - node set of elements (the names of the elements don't matter), with - each element having the following attributes: - - - character, a character to - be replaced - - - string, a string with - which to replace character - - - This function uses map.contents to - do substitution on content, and then returns - the modified contents. - - - This function is a very slightly modified version of Jeni - Tennison’s replace_strings function in the - multiple string replacements section of Dave Pawson’s - XSLT - FAQ. - - The apply-string-subst-map function is - essentially the same function as the - apply-character-map function; the only - difference is that in the map that - apply-string-subst-map expects, oldstring and newstring attributes are used instead of - character and string attributes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -read-character-map -Read in all or part of an XSLT character map - - -Description - -The XSLT 2.0 specification describes character -maps and explains how they may be used to allow a specific -character appearing in a text or attribute node in a final results -tree to be substituted by a specified string of characters during -serialization. The read-character-map function -provides a means for reading and using character maps with XSLT -1.0-based tools. - -It reads the character-map contents from -uri (in full or in part, depending on the value -of the use.subset parameter), then passes those -contents to the apply-character-map function, -along with content, the data on which to -perform the character substition. - -Using the character map "in part" means that it uses only those -output-character elements that match the XPATH expression -given in the value of the subset.profile -parameter. The current implementation of that capability here relies -on the evaluate extension XSLT function. - - - - - - - - - - - - - - - - - - - - -Error: To process character-map subsets, you must use an XSLT engine -that supports the evaluate() XSLT extension function. Your XSLT engine -does not support it. - - - - - - - - - - - - - - @@ -1189,8 +1026,6 @@ around these functions. - - -- 2.40.0