From d574f8021a14d63def8fbc8585e435761201ca55 Mon Sep 17 00:00:00 2001 From: Steve Ball Date: Fri, 31 Aug 2007 00:40:47 +0000 Subject: [PATCH] Added support file. Added style locking. Conversion bug fixes. --- xsl/roundtrip/blocks2dbk.xsl | 5 +- xsl/roundtrip/dbk2wordml.xsl | 2 + xsl/roundtrip/dbk2wp.xsl | 477 ++++++++++++++++++++--------- xsl/roundtrip/normalise-common.xsl | 30 ++ xsl/roundtrip/template.xml | 2 +- 5 files changed, 370 insertions(+), 146 deletions(-) create mode 100644 xsl/roundtrip/normalise-common.xsl diff --git a/xsl/roundtrip/blocks2dbk.xsl b/xsl/roundtrip/blocks2dbk.xsl index a9d8e5c48..b983643db 100644 --- a/xsl/roundtrip/blocks2dbk.xsl +++ b/xsl/roundtrip/blocks2dbk.xsl @@ -1,4 +1,4 @@ - + + +%ext; +]> + diff --git a/xsl/roundtrip/dbk2wp.xsl b/xsl/roundtrip/dbk2wp.xsl index 10f810861..6e36b2f84 100644 --- a/xsl/roundtrip/dbk2wp.xsl +++ b/xsl/roundtrip/dbk2wp.xsl @@ -24,12 +24,17 @@ - - + + - + - + @@ -41,58 +46,70 @@ - + - - + bookinfo | + doc:articleinfo | + doc:chapterinfo | + doc:bookinfo' + mode='doc:body'> + + - + - + - + section nested deeper than 5 levels sect5- - + - + sect - + - - + - - + + - - + - + - - + + select='count(ancestor::*) - count(parent::*[contains(local-name(), "info")]) - 1'/> + select='../parent::*[contains(local-name(current()), "info")] | + parent::*[not(contains(local-name(current()), "info"))]'/> @@ -104,24 +121,32 @@ TODO: Handle all metadata elements, apart from titles. - - + + select='local-name()'/> - - - + + - + @@ -129,7 +154,8 @@ - @@ -139,16 +165,19 @@ - - + - - @@ -158,10 +187,10 @@ - + - @@ -184,16 +213,18 @@ - - - - + + + + select='preceding-sibling::node()[generate-id(following-sibling::*[self::ulink|self::doc:ulink][1]) = generate-id(current())]'> otheraddr @@ -207,10 +238,10 @@ - + + select='*[self::ulink|self::doc:ulink][last()]/following-sibling::node()'/> otheraddr @@ -222,7 +253,7 @@ - @@ -235,23 +266,26 @@ - - - + - - + @@ -281,7 +315,7 @@ + select='following-sibling::node()[generate-id(preceding-sibling::*[self::blockquote|self::calloutlist|self::figure|self::glosslist|self::graphic|self::informalfigure|self::informaltable|self::itemizedlist|self::literallayout|self::mediaobject|self::mediaobjectco|self::note|self::caution|self::warning|self::important|self::tip|self::orderedlist|self::programlisting|self::revhistory|self::segmentedlist|self::simplelist|self::table|self::variablelist | self::doc:blockquote|self::doc:calloutlist|self::doc:figure|self::doc:glosslist|self::doc:graphic|self::doc:informalfigure|self::doc:informaltable|self::doc:itemizedlist|self::doc:literallayout|self::doc:mediaobject|self::doc:mediaobjectco|self::doc:note|self::doc:caution|self::doc:warning|self::doc:important|self::doc:tip|self::doc:orderedlist|self::doc:programlisting|self::doc:revhistory|self::doc:segmentedlist|self::doc:simplelist|self::doc:table|self::doc:variablelist][1]) = generate-id(current())]'/> @@ -299,7 +333,7 @@ - @@ -315,7 +349,7 @@ - @@ -333,47 +367,53 @@ - - + - - + - - - + + - + - - - + + - + - + + select='concat(local-name(), "-", local-name(imagedata|audiodata|videodata|doc:imagedata|doc:audiodata|doc:videodata))'/> @@ -384,10 +424,11 @@ - + + select='concat(local-name(), "-imagedata")'/> @@ -399,23 +440,30 @@ - + + self::calloutlist | + self::doc:imageobject | + self::doc:imagedata | + self::doc:audiodata | + self::doc:videodata | + self::doc:areaspec | + self::doc:calloutlist)]'> - - - - + + + @@ -436,10 +484,10 @@ - + - @@ -449,8 +497,8 @@ - - + + @@ -459,52 +507,58 @@ - - + - - + - - + - + - + - + - + - + - + @@ -518,16 +572,18 @@ - + - + - + - + @@ -595,8 +651,8 @@ - - + + @@ -605,17 +661,18 @@ - + - + - + @@ -638,18 +695,19 @@ - - - @@ -713,77 +771,82 @@ - - + - - + - + - + - + - + - - + - - - - + select='concat(local-name(..), + count(ancestor::itemizedlist|ancestor::orderedlist|ancestor::doc:itemizedlist|ancestor::doc:orderedlist))'/> - + - + - + @@ -792,9 +855,9 @@ - - + @@ -804,11 +867,11 @@ - + - @@ -817,8 +880,8 @@ - - + + @@ -832,7 +895,7 @@ - + @@ -848,16 +911,22 @@ constraint| indexterm|itermset| keywordset| - msg' + msg | + doc:anchor|doc:areaset|doc:audiodata|doc:audioobject| + doc:beginpage| + doc:constraint| + doc:indexterm|doc:itermset| + doc:keywordset| + doc:msg' mode='doc:body'/> - + encountered in - + , but no template matches. @@ -958,17 +1027,114 @@ self::toc | self::videodata | self::videoobject | - self::*[not(starts-with(name(), "informal")) and contains(name(), "info")]'> + + self::doc:abstract | + self::doc:ackno | + self::doc:address | + self::doc:answer | + self::doc:appendix | + self::doc:artheader | + self::doc:authorgroup | + self::doc:bibliodiv | + self::doc:biblioentry | + self::doc:bibliography | + self::doc:bibliomixed | + self::doc:bibliomset | + self::doc:biblioset | + self::doc:bridgehead | + self::doc:calloutlist | + self::doc:caption | + self::doc:classsynopsis | + self::doc:colophon | + self::doc:constraintdef | + self::doc:copyright | + self::doc:dedication | + self::doc:epigraph | + self::doc:equation | + self::doc:example | + self::doc:figure | + self::doc:funcsynopsis | + self::doc:glossary | + self::doc:glossdef | + self::doc:glossdiv | + self::doc:glossentry | + self::doc:glosslist | + self::doc:graphic | + self::doc:highlights | + self::doc:imageobject | + self::doc:imageobjectco | + self::doc:index | + self::doc:indexdiv | + self::doc:indexentry | + self::doc:informalequation | + self::doc:informalexample | + self::doc:informalfigure | + self::doc:lot | + self::doc:lotentry | + self::doc:mediaobject | + self::doc:mediaobjectco | + self::doc:member | + self::doc:msgentry | + self::doc:msgset | + self::doc:part | + self::doc:partintro | + self::doc:personblurb | + self::doc:preface | + self::doc:printhistory | + self::doc:procedure | + self::doc:programlisting | + self::doc:programlistingco | + self::doc:publisher | + self::doc:qandadiv | + self::doc:qandaentry | + self::doc:qandaset | + self::doc:question | + self::doc:refdescriptor | + self::doc:refentry | + self::doc:refentrytitle | + self::doc:reference | + self::doc:refmeta | + self::doc:refname | + self::doc:refnamediv | + self::doc:refpurpose | + self::doc:refsect1 | + self::doc:refsect2 | + self::doc:refsect3 | + self::doc:refsection | + self::doc:refsynopsisdiv | + self::doc:screen | + self::doc:screenco | + self::doc:screenshot | + self::doc:seg | + self::doc:seglistitem | + self::doc:segmentedlist | + self::doc:segtitle | + self::doc:set | + self::doc:setindex | + self::doc:sidebar | + self::doc:simplelist | + self::doc:simplemsgentry | + self::doc:step | + self::doc:stepalternatives | + self::doc:subjectset | + self::doc:substeps | + self::doc:task | + self::doc:textobject | + self::doc:toc | + self::doc:videodata | + self::doc:videoobject | + + self::*[not(starts-with(local-name(), "informal")) and contains(local-name(), "info")]'> - + encountered in - + , but no template matches. @@ -998,7 +1164,30 @@ self::jobtitle | self::personname | self::publishername | - self::remark'> + self::remark | + + self::doc:affiliation | + self::doc:alt | + self::doc:attribution | + self::doc:collab | + self::doc:collabname | + self::doc:confdates | + self::doc:confgroup | + self::doc:confnum | + self::doc:confsponsor | + self::doc:conftitle | + self::doc:contractnum | + self::doc:contractsponsor | + self::doc:contrib | + self::doc:corpauthor | + self::doc:corpcredit | + self::doc:corpname | + self::doc:edition | + self::doc:editor | + self::doc:jobtitle | + self::doc:personname | + self::doc:publishername | + self::doc:remark'> --> @@ -1006,11 +1195,11 @@ - + encountered in - + , but no template matches. diff --git a/xsl/roundtrip/normalise-common.xsl b/xsl/roundtrip/normalise-common.xsl new file mode 100644 index 000000000..f67e40ca2 --- /dev/null +++ b/xsl/roundtrip/normalise-common.xsl @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + diff --git a/xsl/roundtrip/template.xml b/xsl/roundtrip/template.xml index 00b4c7737..1c5db525b 100644 --- a/xsl/roundtrip/template.xml +++ b/xsl/roundtrip/template.xml @@ -1,3 +1,3 @@ -This document left intentionally blankSteve BallSteve Ball8182005-11-03T21:43:00Z2007-01-02T02:29:00Z1535113911.6113This document intentionally left blank. \ No newline at end of file +This document left intentionally blankSteve BallSteve Ball252007-08-21T22:03:00Z2007-08-21T22:03:00Z1535Explain113912This document intentionally left blank. \ No newline at end of file -- 2.40.0