From: Steve Ball Date: Mon, 20 Dec 2004 12:08:23 +0000 (+0000) Subject: modified wordml-to-docbook chain for improved reliability X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b94513e2f7e00f95fca3ef4c9d87f62884444f16;p=docbook-dsssl modified wordml-to-docbook chain for improved reliability --- diff --git a/xsl/wordml/Makefile b/xsl/wordml/Makefile new file mode 100644 index 000000000..4ff14c839 --- /dev/null +++ b/xsl/wordml/Makefile @@ -0,0 +1,21 @@ +STYLESHEETDIR = . + +WORDML = $(STYLESHEETDIR)/docbook.xsl +DBKNORM = $(STYLESHEETDIR)/wordml-normalise.xsl +DBKSECTS = $(STYLESHEETDIR)/wordml-sections.xsl +DBKFINAL = $(STYLESHEETDIR)/wordml-final.xsl +TEMPLATE = /Users/steve/Projects/docbook-cvs/xsl/wordml/template.xml + +PROC = xsltproc + +%.docbook.xml: %.sects.xml $(DBKFINAL) Makefile + $(PROC) -o $@ $(DBKFINAL) $< + +%.sects.xml: %.norm.xml $(DBKSECTS) Makefile + $(PROC) -o $@ $(DBKSECTS) $< + +%.norm.xml: %.wordml.xml $(DBKNORM) Makefile + $(PROC) -o $@ $(DBKNORM) $< + +%.wordml.xml : %.xml $(WORDML) Makefile + xsltproc -o $@ --stringparam wordml.template $(TEMPLATE) $(WORDML) $< diff --git a/xsl/wordml/README b/xsl/wordml/README index 9075d7ef9..55b3ad5ea 100644 --- a/xsl/wordml/README +++ b/xsl/wordml/README @@ -2,7 +2,9 @@ Steve Ball, Bob Stayton -docbook.xsl Accepts DocBook XML and produces WordML -wordml.xsl Accepts WordML and produces DocBook XML - +docbook.xsl Accepts DocBook XML and produces WordML +wordml-normalise.xsl Accepts WordML and produces (1) +wordml-sections.xsl Accepts (1) and produces (2) +wordml-final.xsl Accepts (2) and produces DocBook XML +wordml-*.xsl form a chain of XSL stylesheets to convert WordML into DocBook. diff --git a/xsl/wordml/docbook.xsl b/xsl/wordml/docbook.xsl index ef4477bb8..9915a2246 100755 --- a/xsl/wordml/docbook.xsl +++ b/xsl/wordml/docbook.xsl @@ -12,7 +12,7 @@ xmlns:doc='http://www.oasis-open.org/docbook/xml/4.0' exclude-result-prefixes='doc'> - + + + @@ -220,7 +230,7 @@ - + @@ -613,17 +623,28 @@ + + - + + + + + + - + + + diff --git a/xsl/wordml/sections-spec.xml b/xsl/wordml/sections-spec.xml new file mode 100644 index 000000000..15e4dd838 --- /dev/null +++ b/xsl/wordml/sections-spec.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/wordml/specifications.xml b/xsl/wordml/specifications.xml index 5c30a5a3e..18b3f5342 100755 --- a/xsl/wordml/specifications.xml +++ b/xsl/wordml/specifications.xml @@ -81,6 +81,9 @@ dated 5 November, 2004 Here are the design principles used in this project for selecting Word style names: +Where Word, by default, has a style or feature that corresponds directly to a DocBook element then that style or feature will be used (and documented in this document). For example, the Normal paragraph style maps to a DocBook para element, and a Word table (w:tbl) maps to a DocBook tableIn some cases Word may posess a feature, but it doesn't function in an acceptable manner. For example, lists. In these cases the feature is to be avoided, and a workaround provided.. + + Word paragraph and character style names will match DocBook element names as much as possible. This will enable authors to learn DocBook element names, and help debug problems with conversion. @@ -277,7 +280,7 @@ colwidth="1.00*"/> para -para +para, Normal Any Word paragraph with style Normal will also be converted to a para element. diff --git a/xsl/wordml/template.xml b/xsl/wordml/template.xml index 35b5c673b..ebda1ff92 100644 --- a/xsl/wordml/template.xml +++ b/xsl/wordml/template.xml @@ -1,3 +1,3 @@ -This document left intentionally blankSteve BallSteve Ball14552004-10-04T23:25:00Z2004-11-15T02:42:00Z1535113911.6113This document intentionally left blank. \ No newline at end of file +This document left intentionally blankSteve BallSteve Ball1619902004-10-04T23:25:00Z2004-12-05T19:54:00Z1535113911.6113This document intentionally left blank. \ No newline at end of file diff --git a/xsl/wordml/wordml-final.xsl b/xsl/wordml/wordml-final.xsl new file mode 100644 index 000000000..d160bdbad --- /dev/null +++ b/xsl/wordml/wordml-final.xsl @@ -0,0 +1,928 @@ + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + article + appendix + section + sect1 + section + sect2 + section + sect3 + section + sect4 + section + sect5 + bogus + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates select="w:r|w:hlink"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + figure + informalfigure + + + + + + + + <xsl:copy-of select="$title"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates/> + + + + + + + + + + + + + + + + + + + + + + + + + + + table + informaltable + + + + + + + + <xsl:copy-of select="$title"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates select='w:r|w:hlink'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/wordml/wordml-normalise.xsl b/xsl/wordml/wordml-normalise.xsl new file mode 100644 index 000000000..2ef0d0338 --- /dev/null +++ b/xsl/wordml/wordml-normalise.xsl @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/wordml/wordml-sections.xsl b/xsl/wordml/wordml-sections.xsl new file mode 100644 index 000000000..537da160b --- /dev/null +++ b/xsl/wordml/wordml-sections.xsl @@ -0,0 +1,1452 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/wordml/wordml.xsl b/xsl/wordml/wordml.xsl index 15f39e107..312a7ba52 100755 --- a/xsl/wordml/wordml.xsl +++ b/xsl/wordml/wordml.xsl @@ -1,19 +1,19 @@ + + - + - @@ -57,6 +57,8 @@ match="w:list" use="w:ilst/@w:val"/> + + @@ -76,31 +78,51 @@ - article - appendix - section - sect1 - section - sect2 - section - sect3 - section - sect4 - section - sect5 + article + appendix + section + sect1 + section + sect2 + section + sect3 + section + sect4 + section + sect5 bogus - - - - + + + + + + + + + + + + @@ -125,7 +147,7 @@ - + @@ -143,17 +165,19 @@ + + @@ -175,7 +199,7 @@ + select="following-sibling::*[1][self::&continue;]"/> @@ -215,7 +239,7 @@ @@ -226,14 +250,14 @@ @@ -255,7 +279,7 @@ + select="following-sibling::*[1][self::&continue;]"/> @@ -295,23 +319,22 @@ - - + + select="following-sibling::*[1][self::&continue;]"/> - + @@ -772,31 +795,93 @@ + + + + + + + <xsl:apply-templates select='w:r|w:hlink'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - - - - - - - - + + - - + + + + + + + + + +