From 6e75e2f21663c8dd1d5d97dd969e37c34d628a1b Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Mon, 9 Apr 2001 11:29:18 +0000 Subject: [PATCH] Updated tests --- slides/tests/Makefile | 75 ++++++++++++++ slides/tests/dbgentext.xml | 199 +++++++++++++++++++++++++++++++++++++ 2 files changed, 274 insertions(+) create mode 100644 slides/tests/Makefile create mode 100644 slides/tests/dbgentext.xml diff --git a/slides/tests/Makefile b/slides/tests/Makefile new file mode 100644 index 000000000..75411586a --- /dev/null +++ b/slides/tests/Makefile @@ -0,0 +1,75 @@ +include ../../cvstools/Makefile.incl +HTMLSTYLE=../xsl/linear.xsl +FOSTYLE=../xsl/slidesfo.xsl +VARS= +FORMATTER=xep +BROWSER= +MULTIFRAME=0 +TIDY=1 + +all: + @echo Select a target + +test: test.xml + $(XJPARSE) test.xml +ifeq ($(BROWSER),) + $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) multiframe=$(MULTIFRAME) +else + $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME) +endif + +testcust: + $(XJPARSE) test.xml + +dbgentext: dbgentext.xml + $(XJPARSE) $< +ifeq ($(BROWSER),) + $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) multiframe=$(MULTIFRAME) +else + $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME) +endif +ifeq ($(TIDY),1) + for i in *.html; do \ + if [ "$$i" != "ns4toc.html" ] ; then \ + tidy -iq -latin1 -mn $$i; \ + fi \ + done +endif + +%.fo : %.xml + make -C ../xsl +ifeq ($(FORMATTER),tex) + saxon $< $(FOSTYLE) $@ passivetex.extensions=1 $(VARS) +else +ifeq ($(FORMATTER),fop) + saxon $< $(FOSTYLE) $@ fop.extensions=1 $(VARS) +else + saxon $< $(FOSTYLE) $@ $(VARS) +endif +endif + +%.pdf : %.fo +ifeq ($(FORMATTER),tex) + pdftex "&pdfxmltex" $< + @if [ `grep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \ + pdftex "&pdfxmltex" $< ; \ + fi + @if [ `grep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \ + pdftex "&pdfxmltex" $< ; \ + fi +else +ifeq ($(FORMATTER),fop) + fop $< $@ +else +ifeq ($(FORMATTER),xep) + xep $< +else + echo How would you like me to make the PDF file? +endif +endif +endif + +clean: + rm -f *.html *.fo *.pdf *.ps + rm -f *.log *.aux *.out + diff --git a/slides/tests/dbgentext.xml b/slides/tests/dbgentext.xml new file mode 100644 index 000000000..8ad77b81b --- /dev/null +++ b/slides/tests/dbgentext.xml @@ -0,0 +1,199 @@ + + + + + + + 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. + + +
The Problem + +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: + + + + + + +... +]]> +