Page 1 of 1

Export template for work items (doc /xml)

Posted: Mon Feb 19, 2018 2:50 pm
by natasia0603
Hello,

I am currently trying to generate a doc template for work item export. I found out, that MS Word does not support the used custom markup XML 2003 stuff anymore. Anyway, I started to directly edit the .doc file in an XML editor. That worked quite well so far. But still there are some points which I don't manage to get as I wish to.

My XML code is basically structured like this. (There are multiple <workitem> definitions for multiple types)

Code: Select all

<ns0:workitems>
   [...]
   <workitem type="productRequirement">
      <w:p><w:r><w:t> <type/> </w:t></w:r></w:p>
      <w:p><w:r><w:t> <title/> </w:t></w:r></w:p>
      <w:p><w:r><w:t> <description/> </w:t></w:r></w:p>
      <w:p><w:r><w:t> <customFields id="xxxx"/> </w:t></w:r></w:p>
      <w:p><w:r><w:t> <linkedWorkitems role="medpack_traces_to"></linkedWorkitems> </w:t></w:r></w:p>
   </workitem>
</ns0:workitems>


My questions:
a) no matter what I do, the <title/> gets always the Heading style in word (I just want to have it standard).
b) I only want to have certain custom fields and certain linked work items listed. I tried to do this via "role=...", but it didn't work. After finding the XML Export Schema (https://almdemo.polarion.com/polarion/help/?topic=/com.polarion.xray.doc.user/refchAdminRef.html), I tried the code snippet below. No success so far.

Code: Select all

<linkedWorkitems>
   <LinkedWorkItemList>
      <w:p><w:r><w:t>
         <LinkedWorkItem role="medpack_traces_to"></LinkedWorkItem>
      </w:t></w:r></w:p>
   </LinkedWorkItemList>
</linkedWorkitems>



Does anyone knows how this stuff works?
For reference, I attached the XML full code and an example of the output, feel free to use it. (Note: Even though, export_test.doc is a doc file, it cannot be opened by word. Use an XML editor)

Thank you
Jenny