Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSL Transformation into Word 2003 XML format handling logic to load XML data

 
Gita Maagani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually let me try to make my question simpler

Purpose : to load XML data (data.xml) into Word document (word.docx).

1. Create a word document with merge fields.

2. Create an XML document with data to be filled into Word document Merge fields.

3. Insert XML tags as value of Merge fields ?


I am stuck over here as I am not sure how to insert logic in merge fields. Is it possible ?

Ex :

<xsl:value-of select="books/book/author_name"/>

or

<xsl:if test="books/book/author_name/text() != 'ABC'">

or

<xsl:when test="books/book/author_name/text() = 'ABC'">
some text in word document
</xsl:when>

4. Save word document (word.docx) as word 2003 xml file (word.xml).

5. Use WordprocessingML Transform Inference Tool to convert word 2003 xml file to xsl file (word.xsl).

6. Use Java Transformer to merge word.xsl with data.xml file


Is it possible to insert xsl logic into merge fields in word ?

Or do I need to convert xml to xsl and then add logic ?

I appreciate if anybody can provide me some guidelines.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic