aspose file tools*
The moose likes XML and Related Technologies and the fly likes XSL Transformation into Word 2003 XML format handling logic to load XML data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL Transformation into Word 2003 XML format handling logic to load XML data" Watch "XSL Transformation into Word 2003 XML format handling logic to load XML data" New topic
Author

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

Gita Maagani
Greenhorn

Joined: Mar 28, 2011
Posts: 1
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XSL Transformation into Word 2003 XML format handling logic to load XML data