Giter Site home page Giter Site logo

com.elovirta.ooxml's People

Contributors

dagoss avatar jelovirt avatar robertnthomas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

com.elovirta.ooxml's Issues

Word output not opening after adding XML (XSD) codeblock

I'm working on oxygen 18.1 and Word for Mac.

I created a dita book map, it output just fine as a Word doc, but after adding a reference topic that contains a codeblock presenting a valid XSD file, Word refuses to open the output file.

image

Add dependency on newer ant-contrib library

Right now you have a dependency on ant-contrib 0.6.
I keep getting these warning in the ANT console:

 "trying to override old definition of task for"

Maybe you should try adding a dependency to the newest ant-contrib (1.0b3 I think).
Ideally the dependency to the ant-contrib could be added by a plugin which would always be bundled with the DITA OT (like the base plugin).

w:pPr doubly generated

When I generate .docx, word/document.xml contains multiple w:pPr per w:p such like below:

        <w:p>
            <w:pPr>
                <w:pStyle w:val="BodyText"/>
            </w:pPr>
            <w:pPr>
                <w:pStyle w:val="BodyText"/>
            </w:pPr>
        </w:p>
        <w:p>
            <w:pPr>
                <w:pStyle w:val="ListParagraph"/>
            </w:pPr>
            <w:pPr>
                <w:pStyle w:val="ListParagraph"/>
                <!--depth 1-->
                <w:numPr>
                    <w:ilvl w:val="0"/>
                    <w:numId w:val="101"/>
                </w:numPr>
            </w:pPr>
            <w:bookmarkStart w:id="5" w:name="_Tocd18e26"/>
            <w:bookmarkStart w:id="4" w:name="_Refd18e26"/>
            <w:r>
                <w:t>XSLT</w:t>
            </w:r>
        </w:p>

I generated this result via oXygen 19.0 bundled plug-in.

20170524-list.zip

According to the ISO XML scheme (wml.xsd) w:pPr should be occurred once as the first child element in w:p.

Leading space and trailing space

Redundant one space code remains in final .docx at the top of paragraph or at the end of paragraph.
Please refer to the attached DITA instance and output result.

20170525-space.zip

In XSL-FO to PDF output, they are all removed by Formatter. But in .docx output the plug-in stylesheet should remove them by himself.

Build fails with Invalid dateTime value

The build fails with Invalid dateTime value.

DITA-OT: 2.5
com.elovirta.ooxml branch: master

docx.convert:
     [xslt] Processing C:\Users\eike\DITA\web-client\temp\processing\BHB_UnikatGE_Webclient_MERGED.xml to C:\Users\eike\DITA\web-client\temp\processing\BHB_UnikatGE_Webclient_CLEANED.xml
     [xslt] Loading stylesheet C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\docx\word\document.flat.xsl
     [xslt] Processing C:\Users\eike\DITA\web-client\temp\processing\BHB_UnikatGE_Webclient_CLEANED.xml to C:\Users\eike\DITA\web-client\temp\processing\docx\docProps\core.xml
     [xslt] Loading stylesheet C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\docx\docProps\core.xsl
     [xslt] Processing C:\Users\eike\DITA\web-client\temp\processing\BHB_UnikatGE_Webclient_CLEANED.xml to C:\Users\eike\DITA\web-client\temp\processing\docx\docProps\custom.xml
     [xslt] Loading stylesheet C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\docx\docProps\custom.xsl
     [xslt] Processing C:\Users\eike\DITA\web-client\temp\processing\BHB_UnikatGE_Webclient_CLEANED.xml to C:\Users\eike\DITA\web-client\temp\processing\docx\word\document.xml
     [xslt] Loading stylesheet C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\docx\word\document.xsl
     [xslt] Processing C:\Users\eike\DITA\web-client\temp\processing\BHB_UnikatGE_Webclient_CLEANED.xml to C:\Users\eike\DITA\web-client\temp\processing\docx\word\comments.xml
     [xslt] Loading stylesheet C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\docx\word\comments.xsl
     [xslt] C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\docx\word\document.utils.xsl:42: Fatal Error! Invalid dateTime value "2016-11-11T12:13:52+0100" (Timezone hour must be two digits)
     [xslt] Failed to process C:\Users\eike\DITA\web-client\temp\processing\BHB_UnikatGE_Webclient_CLEANED.xml

BUILD FAILED
C:\Users\eike\DITA\web-client\build.xml:71: The following error occurred while executing this line:
C:\Users\eike\.DITA\dita-ot\build.xml:45: The following error occurred while executing this line:
C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\build.xml:112: Fatal error during transformation using C:\Users\eike\.DITA\dita-ot\plugins\com.elovirta.ooxml\docx\word\comments.xsl: Invalid dateTime value "2016-11-11T12:13:52+0100" (Timezone hour must be two digits); SystemID: file:/C:/Users/eike/.DITA/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.utils.xsl; Line#: 42; Column#: -1

Invalid OOXML output when publishing DITA 1.3 Specs

I downloaded the DITA 1.3 specs from SVN and published the DITA Map "dita-1.3-specification-learningTraining.ditamap" to OOXML.
The resulting ooxml file is invalid.
Reported error when it is opened in MS Office 2013:

  Ambiguous cell mapping encountered. Possible missing paragraph element. <p> elements are required before every </tc>.
 Location: Part: /word/document.xml, Line 78, Column 0

Image not included in docx file

Hi,

The docx produced shows the message "Image UserGuide/MainProductInfo_files/image1.png missing" when the ditamap file referes to dita file in a folder one or more level up then ditamap file container. If you open the docx file with winzip, the image is present in media folder.
The image is present when ditamap is build in pdf format.

The file test.zip contains the plug-in used, document structure, build command line, temporary files and output files (docx and pdf format always correct), in two different folder:

  1. in "test_Ok" folder, the ditamap/dita file structure from which the docx is correcly built and image is present.
  2. in "test_Nok" folder, the ditamap/dita file structure from which the docx build does not contain the image.

I need to keep the case 2 ditamap/dita file structure to keep separate different documents and facilitate the topic reuse putting them in the commontopic folder.

Please, could you help fixing the issue above?

Best regards
Lello

Correct sectPr

Currently all sections are generated as Document Final Section Properties (§17.6.17) when all expect the last w:sectPr should be Section Properties (§17.6.18). Move non-final w:sectPr to the next w:p element.

Invalid REF field code

If I convert attached DITA instance to .docx, the result is fine.

2018-01-06

However after selecting all of the document by Ctrl + A and press F9 to update the field result, Word reports that REF fields are not valid.

2018-01-06-2

This is because the referencing bookmarks are not defined in the converted word/document.xml. The stylesheet should generate accurate field code with the field result, because field may be updated after conversion by user editing.

xref-test.zip

Support for cover page

Add support for generating a cover page when the template contains a cover page section.

Multi-level lists

This is a kind of a subset of #26 but maybe there should be some logic involved too?

Multilevel lists (bullets and/or numbered) come up a lot in DITA and technical writing generally.

Would it make sense to have some logic to map the depth of the physical <li> tags in the DITA to the corresponding standard Word headings (Bullet list / Numbered list)?

Sometimes images are not copied to the DOTM package [DOT 2.x]

If the DITA Map references all images like:

<keydef keys="testK" href="test.jpg" format="jpg"/>

and the topics reference it like:

<image keyref="testK"/>

it seems that the target "docx.package.media" is skipped because it looks at an images list file in the temporary files folder and that list file is empty.

Control Column Widths for Tables?

My word exports appear to be ignoring the colspec colwidth attributes. I've tried explicit and relative values, for example, colwidth = "2in" and colwidth = "2*", but neither appear to work. How can I specify column widths?

Thanks!

Timezone error

When a colleague of mine runs the OOXML transformation on her PC, she gets the following strange timezone error:

[xslt] D:$_checkout$_docs\oxygenDocs\trunk_oxygen_ditaOT2.x\plugins\com.elovirta.ooxml\docx\word\document.utils.xsl:42: Fatal Error! Invalid dateTime value "2017-08-31T16:37:26+0200" (Timezone hour must be two digits)
[xslt] Failed to process C:\Users\xxx.xxx\oxygenOut\temp\oxygen_dita_temp\mcad_installAdminGuide-en_CLEANED.xml

BUILD FAILED
D:$_checkout$_docs\oxygenDocs\trunk_oxygen_ditaOT2.x\build.xml:45: The following error occurred while executing this line:
D:$_checkout$_docs\oxygenDocs\trunk_oxygen_ditaOT2.x\plugins\com.elovirta.ooxml\build.xml:112: Fatal error during transformation using D:$_checkout$_docs\oxygenDocs\trunk_oxygen_ditaOT2.x\plugins\com.elovirta.ooxml\docx\word\comments.xsl: Invalid dateTime value "2017-08-31T16:37:26+0200" (Timezone hour must be two digits); SystemID: file:/D:/$_checkout/$_docs/oxygenDocs/trunk/_oxygen/_ditaOT2.x/plugins/com.elovirta.ooxml/docx/word/document.utils.xsl; Line#: 42; Column#: -1

It works on my machine though. As far as I can tell, she and I have the same time settings.

Custom template generates invalid docx

I'm attempting to use a custom docx file for the dotx.file.

I'm not getting any build errors, but the resulting file is considered corrupt by Word 2013 (I can still open it in LibreOffice Writer, and the content is there).

I've attached the template used during transformation and the resulting document. If I switch the template back to the Normal.docx that comes with this plugin, everything works fine. I suspect there is some undocumented requirement for the template that mine isn't adhering to.

result.docx
Custom_Template.docx

Update ant-contrib

The ant-contrib library is outdated. The shipped version is 0.6 (from 2004-02-18). The current version 1.0b3 is a little bit newer (2006-11-02). This is a library that is usually shipped by many DITA-OT plugins. Therefore you might get into trouble when importing it multiple times in different versions.

  • It would be nice, if the library would be updated.
  • To externalize it, you can also use the utility plugin org.doctales.ant-contrib. I usually add an addtional checker step that looks at the classpath for ant-contrib and fail, if it isn't available. Setting org.doctales.ant-contrib as a requirement could also work but may lead to issues, if a user does not want to install it, because another plugin already provides that library.

But maybe ant-contrib is completely obsolete here, as stated in #40 (comment)

Parameter id is not declared in the called template

Processing fails with message Parameter id is not declared in the called template.

The error points to the following template in
document.abbrev-d.xsl

<xsl:template match="*" mode="ditamsg:no-glossentry-for-abbreviated-form">
  <xsl:param name="keys"/>
  <xsl:call-template name="output-message">
    <xsl:with-param name="id">DOTX060W</xsl:with-param>
    <xsl:with-param name="msgparams">%1=<xsl:value-of select="$keys"/></xsl:with-param>
  </xsl:call-template>
</xsl:template>

Stacktrace: stacktrace.txt

Environment

  • dita-ot: 2.2.5
  • com.elovirta.ooxml: 9d2f637

Separation of "NOTE:" and note text

When <node>node text</node> is translated from DITA, the Word doc contains NOTE:node text (no space between colon and the note text). Despite line 609 of /docx/word/document.topic.xsl:

<w:t> </w:t>

(I myself decided to use the <w:tab/> instead, which is commented out in the line before)

Ambiguous rule match for li

I've got some matching issues.

DITA-OT: 2.5.4
Branch: master
OS: Windows 7

docx.convert:
     [xslt] : Error! Ambiguous rule match for /dakosyBookmap/dakosyConcept[14]/dakosyConcept[5]/dakosyConcept[2]/dakosyTask[1]/taskbody[1]/steps[1]/step[9]/stepresult[1]/note[1]/ul[1]/li[2]/dl[1]
     [xslt] Matches both "*[contains(@class, ' topic/li ')]/*" on line 647 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] and "*[contains(@class, ' topic/note ')]//*[contains(@class, ' topic/li ')]//*" on line 764 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] : Error! Ambiguous rule match for /dakosyBookmap/dakosyConcept[14]/dakosyConcept[5]/dakosyConcept[2]/dakosyTask[1]/taskbody[1]/steps[1]/step[9]/stepresult[1]/note[1]/ul[1]/li[2]/dl[1]
     [xslt] Matches both "*[contains(@class, ' topic/li ')]/*" on line 647 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] and "*[contains(@class, ' topic/note ')]//*[contains(@class, ' topic/li ')]//*" on line 764 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] : Error! Ambiguous rule match for /dakosyBookmap/dakosyConcept[14]/dakosyConcept[7]/dakosyConcept[2]/dakosyConcept[2]/dakosyTask[1]/taskbody[1]/steps[1]/step[18]/stepresult[1]/note[1]/ul[1]/li[2]/p[2]
     [xslt] Matches both "*[contains(@class, ' topic/li ')]/*" on line 647 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] and "*[contains(@class, ' topic/note ')]//*[contains(@class, ' topic/li ')]//*" on line 764 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] : Error! Ambiguous rule match for /dakosyBookmap/dakosyConcept[14]/dakosyConcept[7]/dakosyConcept[2]/dakosyConcept[2]/dakosyTask[1]/taskbody[1]/steps[1]/step[18]/stepresult[1]/note[1]/ul[1]/li[2]/p[2]
     [xslt] Matches both "*[contains(@class, ' topic/li ')]/*" on line 647 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] and "*[contains(@class, ' topic/note ')]//*[contains(@class, ' topic/li ')]//*" on line 764 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] : Error! Ambiguous rule match for /dakosyBookmap/dakosyConcept[14]/dakosyConcept[7]/dakosyConcept[3]/dakosyTask[1]/taskbody[1]/steps[1]/step[16]/info[1]/note[1]/ul[1]/li[2]/p[2]
     [xslt] Matches both "*[contains(@class, ' topic/li ')]/*" on line 647 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] and "*[contains(@class, ' topic/note ')]//*[contains(@class, ' topic/li ')]//*" on line 764 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] : Error! Ambiguous rule match for /dakosyBookmap/dakosyConcept[14]/dakosyConcept[7]/dakosyConcept[3]/dakosyTask[1]/taskbody[1]/steps[1]/step[16]/info[1]/note[1]/ul[1]/li[2]/p[2]
     [xslt] Matches both "*[contains(@class, ' topic/li ')]/*" on line 647 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
     [xslt] and "*[contains(@class, ' topic/note ')]//*[contains(@class, ' topic/li ')]//*" on line 764 of file:/C:/Users/eike/.dita/dita-ot/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl

Comments made with Oxygen Author breaks conversion

Example:
<?oxy_comment_start author="xxx" timestamp="20170412T163115+0300" comment="xxx"
causes error message:
Invalid dateTime value "2017-11-14T11:33:33+0300" (Timezone hour must be two digits)
document.utils.xsl; Line#: 42

Handle missing images

When the source image for <image> is missing, a reference to a non-existing is generated in OOXML. The conversion should identify missing images and ignore the images.

Better handling for image maps

If in the DITA content I have an image map:

<imagemap id="personal_xsd_Element_p_person">
                                    <image href="img/personal_xsd_Element_p_person.jpeg"/>
                                        <area>
                                            <shape>rect</shape>
                                            <coords>147,46,251,97</coords>
                                            <xref href="personal_xsd_Element_p_person.dita#person_id"/>
                                        </area>
                                </imagemap>

right now the Word output outputs all the text content from the area including the coordinates.
It could do one of two things:

  1. Quick fix, avoid outputting anything for the element.
  2. Behave as the PDF output does, create callout links after the image, somehow for each xref create a paragraph containing a link to the target and an index.

Support for both portrait and landscape pages?

Is there a way to set the page orientation for each topic?

Ideally, I want to use the outputclass attribute in each topicref, setting the value to "portrait" or "landscape" and have it export accordingly.

Redundant w:num & w:abstractNum in numbering.xml

.docx/word/numbering.xml contains:

  1. Redundant w:abstractNum. It is generated per list. In practical it should be defined once and should be reused via w:num.
  2. Non referenced w:num(s). They are not used from word/document.xml.

20170524-list.zip

This sample is generated via oXygen 19.0 bundled plug-in.

DITA Title - Word Heading numbering doubled up

I'm getting the numbering from my Word styles (in the normal.dotm template) plus the additional title numbering I assume from the DITA processing for a total of 2 numbers per top level heading in the Word doc output. Is there any way to stop adding heading numbers into the heading text when the Word style is a numbered style (I guess probably not)?

Link text for Xref links to topics is not resolved

I have a DITA topic looking like this:

    <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
    <topic id="introduction">
        <title>Introduction</title>
        <body>
            <p>This is it <xref href="#topic_tnd_j4h_kz" format="dita"/></p>
        </body>
        <topic id="topic_tnd_j4h_kz">
            <title>Second topic</title>
        </topic> 
    </topic>

When publishing to Word the xref is not properly resolved, you end up in the Word document with "Error! Reference source not found." errors.
XHTML and PDF output formats properly work.

Transform fails when transforming to docx

While transforming a document using the plugin, the build fails with the error shown in the attached log file.
ant.log.txt

The document does build with a PDF-based transform and although the message appears to come from the simpletable template, there is no simpletable in the source.

I've attached a zip file of the temp directory created by the transform.
temp.zip

Reported ambiguos rule match

During the transformation an ambiguous rule match is reported:

 [xslt] : Error! Ambiguous rule match for /map/topic[4]/glossentry[1]/glossterm[1]
 [xslt] Matches both "*[contains(@class, ' glossentry/glossterm ')]" on line 654 of file:/D:/projects/eXml/frameworks/dita/DITA-OT2.x/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
 [xslt] and "*[contains(@class, ' topic/topic ')]/ *[contains(@class, ' topic/title ')]" on line 114 of file:/D:/projects/eXml/frameworks/dita/DITA-OT2.x/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl

Align HTML style names to default template

The default DOCX template declares the names of the HTML related styles like e.g. HTML Typewriter in /word/styles.xml (within the DOCX/ZIP). However the document.pr-d.xsl maps e.g. DITA's codeph element to the style HTMLTypewriter (note the missing space).

As the default template only declares (but not defines) e.g. HTML Typewriter, the output will look the same also with the aligned style name. But when that style is explicitely added to the default template or a custom template with the style is used, this would enable the intended (monospace) formatting.

Therefore it would be great if such style names in the document.pr-d.xsl could be fixed/aligned to the respective style names of the default template's styles.xml.

(possibly related to #26)

Build error in docx.image-metadata

I encountered build error in docx.image-metadata when I installed this plug-in into DITA-OT 2.4.6.

preprocess:

docx.image-metadata:

BUILD FAILED
D:\DITA-OT\dita-ot-2.4.6\build.xml:45: The following error occurred while executing this line:
D:\DITA-OT\dita-ot-2.4.6\plugins\com.elovirta.ooxml\build.xml:36: module doesn't support the nested "ditaFileset" element.

Total time: 13 seconds

The process finished with exit code: 1

I attached sample data and log file. Could you suggest me how to solve this issue?

20170419-sample-en-for-word.zip

Regards,

Toshihiko Makita

Template problem

Hi Jarno
I want modify the Normal.dotx that comes with the plugin. When I open and save it under a new name and use this new template in built.xml, the output doesn't look like as with the original Normal.dotx. For instance, all heading styles are gone and so are the table borders. The size of the new template decreases from 78 KB to 28 KB. So, something is stripped out here.

Which Word version and language is recommended to make template modifications? I use Word 2010 (German). I tried Libre Writer too, but then the result can not be openend by Word.

Windows 7 x64
DITA-OT 2.5.4

Thanks
Chris.

Aligning Word output styles to pre-existing Word template?

Thanks for the great work so far! 🥇

I need to do one last tweak to the plugin before I can put in into production:

I have a Word template with highly customized styles.

These aren't always the styles used by the DITA-Word converter.

Which angle is best/simplest to start from in order to align them?

Edit the Word template to match whatever heading/numberedlist/bulletlist/emphasis etc. are already mapped in the plugin? Is there a full listing of these I can see?

Or edit some config file in the plugin (if so, which one please?) to match my existing Word setup (it is not too complex, it has numbered headings 1-9, bullet list, normal, I use the default Word HTML Code a lot... and that's almost everything)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.