From: Steve Ball Date: Fri, 7 Oct 2005 06:43:02 +0000 (+0000) Subject: fixed Makefile X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f977fbead970ea8facd56d1d2594d1c0499f98e;p=docbook-dsssl fixed Makefile added many features to Pages support added revhistory, inlines, highlights, abstract --- diff --git a/xsl/wordml/Makefile b/xsl/wordml/Makefile index 4ff14c839..fe6057f27 100644 --- a/xsl/wordml/Makefile +++ b/xsl/wordml/Makefile @@ -1,13 +1,40 @@ +# Change this to where you are storing your roundtripping stylesheets STYLESHEETDIR = . +PARAMPROF=.param.profiled +PARAMSTRIP=.param.stripped + WORDML = $(STYLESHEETDIR)/docbook.xsl +PAGES = $(STYLESHEETDIR)/docbook-pages.xsl DBKNORM = $(STYLESHEETDIR)/wordml-normalise.xsl +PAGESNORM = $(STYLESHEETDIR)/pages-normalise.xsl DBKSECTS = $(STYLESHEETDIR)/wordml-sections.xsl DBKFINAL = $(STYLESHEETDIR)/wordml-final.xsl -TEMPLATE = /Users/steve/Projects/docbook-cvs/xsl/wordml/template.xml +TEMPLATE = $(STYLESHEETDIR)/template.xml +TEMPLATEPAGES = $(STYLESHEETDIR)/template-pages.xml PROC = xsltproc +include Makefile.param + +all: param.xsl + +param.xsl: param.xweb + ../../cvstools/paramchk -m Makefile.param $< + $(XSLT) $< ../profiling/profile.xsl $(PARAMPROF) profile.condition=wordml + $(XSLT) $(PARAMPROF) ../profiling/strip-attributes.xsl $(PARAMSTRIP) attributes=condition + $(XSLT) $(PARAMSTRIP) ../../litprog/xtangle.xsl $@ + $(RM) $(PARAMPROF) $(PARAMSTRIP) + +Makefile.param: + ../../cvstools/paramchk -m $@ param.xweb + +clean: + $(RM) param.xsl + $(RM) Makefile.param + echo "# foo" > Makefile.param + +# WordML-to-DocBook %.docbook.xml: %.sects.xml $(DBKFINAL) Makefile $(PROC) -o $@ $(DBKFINAL) $< @@ -17,5 +44,20 @@ PROC = xsltproc %.norm.xml: %.wordml.xml $(DBKNORM) Makefile $(PROC) -o $@ $(DBKNORM) $< -%.wordml.xml : %.xml $(WORDML) Makefile +# Pages-to-DocBook +%.pdocbook.xml: %.psects.xml $(DBKFINAL) Makefile + $(PROC) -o $@ $(DBKFINAL) $< + +%.psects.xml: %.pnorm.xml $(DBKSECTS) Makefile + $(PROC) -o $@ $(DBKSECTS) $< + +%.pnorm.xml: %.pages.xml $(PAGESNORM) Makefile + $(PROC) -o $@ $(PAGESNORM) $< + +# DocBook-to-WordML +%.wordml.xml : %.xml $(WORDML) $(TEMPLATE) Makefile xsltproc -o $@ --stringparam wordml.template $(TEMPLATE) $(WORDML) $< + +# DocBook-to-Pages +%.pages.xml: %.xml $(PAGES) $(TEMPLATEPAGES) Makefile + xsltproc -o $@ --stringparam pages.template $(TEMPLATEPAGES) $(PAGES) $< diff --git a/xsl/wordml/docbook-pages.xsl b/xsl/wordml/docbook-pages.xsl index ed852586f..d035863d4 100644 --- a/xsl/wordml/docbook-pages.xsl +++ b/xsl/wordml/docbook-pages.xsl @@ -5,11 +5,12 @@ xmlns:sf="http://developer.apple.com/namespaces/sf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sl="http://developer.apple.com/namespaces/sl" + xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:w='urn:not-yet-implemented' xmlns:wx='urn:not-yet-implemented' xmlns:aml='urn:not-yet-implemented' xmlns:doc='http://www.oasis-open.org/docbook/xml/4.0' - exclude-result-prefixes='doc'> + exclude-result-prefixes='doc xi w wx aml'> @@ -28,6 +29,12 @@ + + + + @@ -58,6 +65,7 @@ + @@ -67,42 +75,111 @@ - + - + - + + + + + - paragraph-style- section nested deeper than 5 levels - 50 - - - 52 + + + sect5- + + + - - 3 + + + + sect + + - + + + + + + + + + - + + + + + + + + sect + + - + + + + + + + + + - + + + - - 38 + + + + + - + + + + + + + + - + + + + - 38 + + Title + @@ -119,40 +196,51 @@ - - - - - + + + + + + + + + - + + - - - - - + + + + + affiliation + + - + + - - - - - + + + + + para-continue + + - + + @@ -162,23 +250,23 @@ - + - - - - - + - - - - + + + + + + + + - + - + @@ -190,14 +278,16 @@ - - - - - + + + + + email + + - - + + @@ -247,15 +337,17 @@ - - - - - - - + + + + + + ulink + + + - + @@ -263,16 +355,76 @@ - - - - - + + + + + releaseinfo + + - + + + + + + + + + + + + revision + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + revremark + + + + + + + + + + + + + abstract + @@ -282,28 +434,37 @@ - + + + + - + - + + + + - + + + + - + - + @@ -311,31 +472,217 @@ - + + + + simpara + + - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + para + + + + + + + + + + + + + emphasis-underline + + + + + emphasis-bold + + + + + emphasis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -title + + + + + + + + + + + + + + + + + informalfigure-imagedata + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + textobject-title + + + + Text Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + first element in a question must be a paragraph + + + + + + + + + + + @@ -500,28 +847,11 @@ - - - - - - - - - - - - - - - - - - + - + @@ -530,22 +860,14 @@ - - - - - + - - - - - + @@ -556,31 +878,27 @@ - - - - - - + + - - - - - - + + - + - + + + - + + @@ -607,18 +925,25 @@ - + - - - - - - + + + + + + + - + + + + + - + + @@ -626,18 +951,32 @@ - - - - - - - - - + + + + + + + highlights- + + + + + + + + + + + + + + + - + + @@ -699,6 +1038,19 @@ + + + + + xinclude + + + + + + + + - - - - - - - encountered - - in - - - , but no template matches. - - + + + + inlineerror + + + + + encountered + + in + + + , but no template matches. + @@ -884,59 +1250,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - - - - - - - - - + + + + + attribute-name + + + + + + + + attribute-value + + + + + + + + + + + + + + + + diff --git a/xsl/wordml/pages-normalise.xsl b/xsl/wordml/pages-normalise.xsl index 361e5339c..fcb6e6091 100644 --- a/xsl/wordml/pages-normalise.xsl +++ b/xsl/wordml/pages-normalise.xsl @@ -80,6 +80,21 @@ + + + + + + + + + + + + + + + diff --git a/xsl/wordml/sections-spec.xml b/xsl/wordml/sections-spec.xml index 15e4dd838..49ba53eb3 100644 --- a/xsl/wordml/sections-spec.xml +++ b/xsl/wordml/sections-spec.xml @@ -1,6 +1,7 @@ - + + diff --git a/xsl/wordml/specifications.xml b/xsl/wordml/specifications.xml index e4a0790ec..bf0253976 100755 --- a/xsl/wordml/specifications.xml +++ b/xsl/wordml/specifications.xml @@ -5,8 +5,7 @@ BobStaytonSagehill Enterprises SteveBallZveno -Draft Version 1.0, -dated 5 November, 2004 +Version 1.1, dated 28 September 2005 This document specifies how DocBook elements can be mapped to Microsoft Word styles. The specifications will be used to write conversions between DocBook XML and Microsoft's WordProcessingML (WordML). @@ -22,7 +21,7 @@ dated 5 November, 2004 DocBook XML documents could be styled for output using the typesetting features of Word. -This specification describes how DocBook elements could map to a set of Word paragraph and character styles. It defines a specific set of style names for which a Word style template can be created. The style names would also be used in XSLT template match patterns for conversion. +This specification describes how DocBook elements could map to a set of Word paragraph and character styles. It defines a specific set of style names for which a Word style template can be created. The style names would also be used in XSLT template match patterns for conversion. Although originally targetted to MS Word, the system has subsequently been extended to use other word processors, notably Apple's Pages.
Project goals @@ -50,7 +49,7 @@ dated 5 November, 2004
Why basic DocBook? It isn't clear that this project will ever be able to support all DocBook elements and structure. The project will initially focus on a basic set of commonly used DocBook elements to demonstrate the feasibility and usefulness of using Word with DocBook. -One problem facing this conversion project is the sheer number of DocBook elements, over 400 in DocBook 4.3. To support DocBook structural models, several of the elements will require more than one Word style. This could lead to a very long and unwieldy list of styles in the Word interface. That would make authoring less efficient and discourage users. +One problem facing this conversion project is the sheer number of DocBook elements, over 400 in DocBook 4.3. To support DocBook structural models, several of the elements will require more than one Word style. This could lead to a very long and unwieldy list of styles in the Word interface. That would make authoring less efficient and discourage users. So this project assumes that authors who need the full set of DocBook elements will use an XML authoring tool that better supports them. This project will enable authors to write basic DocBook documents using Word. Because Word is so widespread, this project will help a lot of new DocBook users get started with familiar tools. They can then graduate to more advanced tools as their needs develop.
@@ -78,6 +77,7 @@ dated 5 November, 2004 Nesting of block elements is another commonly used feature of DocBook. It is not possible to use Word's outline mode for blocks if it is being used for components and sections. So in this specification, nesting of block elements is indicated by adding a number suffix to a style. So a Word paragraph with style orderedlist2 is considered to be contained within a preceding paragraph with style listitem. In Word, paragraph indent levels will be used to visually indicate nesting of blocks. Nesting of inline DocBook elements is particularly difficult to support because Word does not nest character styles. That means a nested inline would require a separate Word style to indicate the parent-child relationship. Given the large number of combinations possible, a prohibitively large number of character styles would have to be created. In this project, nesting of character styles will not be supported in the first release. Nested inlines being imported from DocBook will be converted to a sequence of single-name Word character styles. In many cases, DocBook structure can be derived from the flat Word sequence of paragraphs based on sibling relationships. For example, when a paragraph styled as para is followed by a paragraph styled as itemizedlist, the conversion to DocBook will output a para element and then start an itemizedlist element, with the second paragraph as its first listitem. All itemizedlist paragraphs that follow without interruption are put in the same itemizedlist element. +Some combinations of elements cannot be supported (at least not with the techniques as described in this document). An example is informalexample and its permitted content; there is no title to mark the beginning of the element and no marker for the end of the element, also there are too many parent-child combinations to reasonably define style names. Here are the design principles used in this project for selecting Word style names: @@ -439,6 +439,46 @@ variablelist4 Should immediately follow a blockquote paragraph in Word. +highlights/para +highlights +Consecutive highlights paragraphs are coalesced into a single highlights parent. + + +highlights/itemizedlist/listitem/para +highlights-itemizedlist +Nested lists are not currently supported. + + +highlights/orderedlist/listitem/para +highlights-orderedlist +Nested lists are not currently supported. + + +highlights/caution +highlights-caution + + + +highlights/important +highlights-important + + + +highlights/note +highlights-note + + + +highlights/tip +highlights-tip + + + +highlights/warning +highlights-warning + + + Inline elements diff --git a/xsl/wordml/template-pages.xml b/xsl/wordml/template-pages.xml index e3d154de9..3f87af926 100644 --- a/xsl/wordml/template-pages.xml +++ b/xsl/wordml/template-pages.xml @@ -1,2 +1,2 @@ - -Lorem ipsum dolor sit ametConsectetur adipiscing elitEset eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda et tam. Neque pecun modut est neque nonor et imper ned libidig met, consectetur adipiscing elit, sed ut labore et dolore magna aliquam is nostrud exercitation ullam mmodo consequet.Duis aute in voluptate velit esseCillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon. Offoctivo immoriatoly, hawrgasi pwicos asi sirucor. Thas sirutciun applios tyu thuso itoms ghuso pwicos gosi sirucor in mixent gosi sirucor ic mixent ples cak ontisi sowios uf Zerm hawr rwivos. Unte af phen neige pheings atoot Prexs eis phat eit sakem eit vory gast te Plok peish ba useing phen roxas. Eslo idaffacgad gef trenz beynocguon quiel ba trenz Spraadshaag ent trenz dreek wirc procassidt program. Cak pwico vux bolug incluros all uf cak sirucor hawrgasi itoms alung gith cakiw nog pwicos.Plloaso mako nuto uf cakso dodtosKoop a cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel ba mada su otrenzr swipontgwook proudgs hus yag su ba dagarmidad. Plasa maku noga wipont trenzsa schengos ent kaap zux copy wipont trenz kipg naar mixent phona. Cak pwico siructiun ruos nust apoply tyu cak UCU sisulutiun munityuw uw cak UCU-TGU jot scannow. Trens roxas eis ti Plokeing quert loppe eis yop prexs. Piy opher hawers, eit yaggles orn ti sumbloat alohe plok. Su havo loasor cakso tgu pwuructs tyu InfuBwain, ghu gill nug bo suloly sispunsiblo fuw cakiw salo anr ristwibutiun. Hei muk neme eis loppe. Treas em wankeing ont sime ploked peish rof phen sumbloat syug si phat phey gavet peish ta paat ein pheeir sumbloats. Aslu unaffoctor gef cak siructiun gill bo cak spiarshoot anet cak GurGanglo gur pwucossing pwutwam. Ghat dodtos, ig pany, gill bo maro tyu ucakw suftgasi pwuructs hod yot tyubo rotowminor. Plloaso mako nuto uf cakso dodtos anr koop a cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel ba mada su otrenzr swipontgwook proudgs hus yag su ba dagarmidad. Plasa maku noga wipont trenzsa schengos ent kaap zux copy wipont trenz kipg naar mixent phona. Cak pwico siructiun ruos nust apoply tyu cak UCU sisulutiun munityuw uw cak UCU-TGU jot scannow. Trens roxas eis ti Plokeing quert loppe eis yop prexs. Piy opher hawers, eit yaggles orn ti sumbloat alohe plok. Su havo loasor cakso tgu pwuructs tyu.Document TemplateInsert content here + +Lorem ipsum dolor sit ametConsectetur adipiscing elitEset eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda et tam. Neque pecun modut est neque nonor et imper ned libidig met, consectetur adipiscing elit, sed ut labore et dolore magna aliquam is nostrud exercitation ullam mmodo consequet.Duis aute in voluptate velit esseCillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon. Offoctivo immoriatoly, hawrgasi pwicos asi sirucor. Thas sirutciun applios tyu thuso itoms ghuso pwicos gosi sirucor in mixent gosi sirucor ic mixent ples cak ontisi sowios uf Zerm hawr rwivos. Unte af phen neige pheings atoot Prexs eis phat eit sakem eit vory gast te Plok peish ba useing phen roxas. Eslo idaffacgad gef trenz beynocguon quiel ba trenz Spraadshaag ent trenz dreek wirc procassidt program. Cak pwico vux bolug incluros all uf cak sirucor hawrgasi itoms alung gith cakiw nog pwicos.Plloaso mako nuto uf cakso dodtosKoop a cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel ba mada su otrenzr swipontgwook proudgs hus yag su ba dagarmidad. Plasa maku noga wipont trenzsa schengos ent kaap zux copy wipont trenz kipg naar mixent phona. Cak pwico siructiun ruos nust apoply tyu cak UCU sisulutiun munityuw uw cak UCU-TGU jot scannow. Trens roxas eis ti Plokeing quert loppe eis yop prexs. Piy opher hawers, eit yaggles orn ti sumbloat alohe plok. Su havo loasor cakso tgu pwuructs tyu InfuBwain, ghu gill nug bo suloly sispunsiblo fuw cakiw salo anr ristwibutiun. Hei muk neme eis loppe. Treas em wankeing ont sime ploked peish rof phen sumbloat syug si phat phey gavet peish ta paat ein pheeir sumbloats. Aslu unaffoctor gef cak siructiun gill bo cak spiarshoot anet cak GurGanglo gur pwucossing pwutwam. Ghat dodtos, ig pany, gill bo maro tyu ucakw suftgasi pwuructs hod yot tyubo rotowminor. Plloaso mako nuto uf cakso dodtos anr koop a cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel ba mada su otrenzr swipontgwook proudgs hus yag su ba dagarmidad. Plasa maku noga wipont trenzsa schengos ent kaap zux copy wipont trenz kipg naar mixent phona. Cak pwico siructiun ruos nust apoply tyu cak UCU sisulutiun munityuw uw cak UCU-TGU jot scannow. Trens roxas eis ti Plokeing quert loppe eis yop prexs. Piy opher hawers, eit yaggles orn ti sumbloat alohe plok. Su havo loasor cakso tgu pwuructs tyu.Document TemplateInsert content here diff --git a/xsl/wordml/template.xml b/xsl/wordml/template.xml index b1866009c..619ee8996 100644 --- a/xsl/wordml/template.xml +++ b/xsl/wordml/template.xml @@ -1,3 +1,3 @@ -This document left intentionally blankSteve BallSteve Ball2533192004-10-04T23:25:00Z2005-03-08T02:29:00Z1535113911.6113This document intentionally left blank. \ No newline at end of file +This document left intentionally blankSteve BallSteve Ball320172005-10-02T13:41:00Z2005-10-03T23:18: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 index cb5348f9c..9cf0858b6 100644 --- a/xsl/wordml/wordml-final.xsl +++ b/xsl/wordml/wordml-final.xsl @@ -21,24 +21,42 @@ + + - - - - + + + + + + + + + + + + + + + + + + + + @@ -58,15 +76,22 @@ + + + + + + ]> - + exclude-result-prefixes="aml w wx o v"> @@ -74,7 +99,8 @@ + doctype-system="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" + cdata-section-elements='programlisting literallayout'/> @@ -180,13 +206,24 @@
- + <xsl:apply-templates select="w:r|w:hlink"/> - + @@ -246,7 +283,14 @@ - + @@ -285,6 +329,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -391,10 +555,10 @@ - - + + - - - + - - - - + + + + - - - - - - - + + - - - - + - - - + + - - - + + + - + - - + + - - - - - + + + + - - - - - + + + - + - - + + - - - + - - - - + + + + - - - + + - - - - - - - + + + + + + - - - - - + - - - + + + + + + @@ -556,12 +716,68 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -692,84 +908,167 @@ - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates select='w:r|w:hlink'/> + + + + + + + + + + + + + + + + + - - - + + - - - + + +
- - + + - - + + - - + - - + - - - - - - - - - + + + + + + + + + - - - figure - informalfigure - - + + + figure + informalfigure + + - - - - - <xsl:copy-of select="$title"/> - - - - - - - - - - - - - - - - + + + + + <xsl:copy-of select="$title"/> + + + + + + + - - - - - + + + + + + + + + + + + + + - + @@ -989,107 +1288,221 @@ - - + + - - - - <xsl:apply-templates select='w:r|w:hlink'/> - + + + + <xsl:apply-templates select='w:r|w:hlink'/> + - - + + - - - + - - - - - - - - - + + + + + + + + + - - - + + + - - + + - - - + - - - - - + + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + - + + - - - - - - + + + + + + + + + + + - + + + + + + + + + + + + - - - + + + - - + + + + + + + + diff --git a/xsl/wordml/wordml-sections.xsl b/xsl/wordml/wordml-sections.xsl index 537da160b..193e89429 100644 --- a/xsl/wordml/wordml-sections.xsl +++ b/xsl/wordml/wordml-sections.xsl @@ -9,6 +9,8 @@ + + @@ -66,13 +68,13 @@ - + - + @@ -189,8 +191,8 @@ - - + +