From 75b57f522702c6a6eef6c3c49538eaf245c24a10 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 27 Apr 2005 14:47:27 +0000 Subject: [PATCH] added test for support of "dbhtml dir" PI --- slides/tests/Makefile | 3 +- slides/tests/dbhtml-dir.xml | 216 ++++++++++++++++++++++++++++++++++++ 2 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 slides/tests/dbhtml-dir.xml diff --git a/slides/tests/Makefile b/slides/tests/Makefile index 0f8201062..bcee6d89e 100644 --- a/slides/tests/Makefile +++ b/slides/tests/Makefile @@ -11,7 +11,7 @@ MULTIFRAME=0 FRAMES=0 OVERLAY=1 TIDY=0 -XML_FILES=dbgentext.xml minimal.xml test-full.xml test.xml testcust.xml testfull.xml tr-862918.xml +XML_FILES=dbgentext.xml dbhtml-dir.xml minimal.xml test-full.xml test.xml testcust.xml testfull.xml tr-862918.xml PDF_FILES = $(foreach file,$(basename $(XML_FILES)),$(file).pdf) HTML_FILES = $(foreach file,$(basename $(XML_FILES)),$(file).html) @@ -79,4 +79,5 @@ endif clean: rm -f *.html *.fo *.pdf *.ps rm -f *.log *.aux *.out + rm dbhtml-dir-test/*.html diff --git a/slides/tests/dbhtml-dir.xml b/slides/tests/dbhtml-dir.xml new file mode 100644 index 000000000..66bf286a8 --- /dev/null +++ b/slides/tests/dbhtml-dir.xml @@ -0,0 +1,216 @@ + + + + + + Supporting Localized Generated Text + Generated Text + NormanWalsh + Sunday, 08 Apr 2001 + + XSLTUK-01 + 08 Apr - 09 Apr 2001 + Keble College, Oxford, UK + 1 + + Version TEST + 2001 + Sun Microsystems, Inc. + + +Introduction + + +Say something pithy in the introduction + + +This is the introductory slide + + +The Problem + +This is on the foilgroup slide. + + +Remember to describe the use-caess + + +Generated Text + +Semantic markup often omits text that can be generated +automatically + +Different contexts require different generated text, +naturally + +Generated text is locale-specific + + + + +An Example +An obvious, common example is chapter title markup. Consider: + +<chapter label="3"><title>Some Title</title> ... + +The title page for a chapter varies by location: + + +English: + +Chapter 3. Some Title + +French: + +Chapitre 3. Some Title + + + + + +A Solution + +The Old Solution + +Replace this + + +

+ ]]> + ]]> ]]> +

+]]>
+ +with this + + +

+ ]]> + Chapter + ]]>]]> + ]]>]]> +

+]]>
+
+ +Generated from Localization Data +L10N Data + +Where the generated text for words like Chapter +is taken from an independently maintained lookup table: + + + + + + +... + +...]]> + + +Problems + +Single-word localization (doesn't support Japanese) + +Hard-coded presentation elements (number and title) + +Hard-coded presentation order (gentext, number, title) + +Hard-coded number format + + + + +
+A Better Solution + +Use Markup Templates + +Use a lookup function to determine the markup template in addition +to the keywords. For example, the markup template lookup +table for a chapter title looks something like this: + + + + + +LocalizationTemplate Returned + + +EnglishChapter %n. %t +FrenchChapitre %n. %t + + + + +The markers, %n, %t, and +%s (not shown) are replaced by the lable, title, and +subtitle of the component, respectively. + + + +The <quote>New</quote> Solution + +Find the template and fill it in: + + + + + + + + + + +]]> + + +Generated from Localization Data +L10N Data + +In order to make this work, the localization data is extended: + + + + + + +... +]]> +