Difference between revisions of "Including XML on an MS Word Merge Document"

(Created page with 'This article explain how to use the data stored within SmartSimple XML field to display on a Word Merge Field. XML data can be displayed on a Word Merge as either a singl…')
 
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This article explain how to use the data stored within [[SmartSimple]] XML field to display on a Word Merge Field.   
+
This article explains how to use the data stored within a SmartSimple [[Custom Field Type: Special - XML Data|XML field]] on a [[Word Merge]] document.   
  
 +
Word Merges can either draw in a single value from an [[XML]] "node" or the XML data can be displayed as a table.
  
XML data can be displayed on a Word Merge as either a single value or table.
+
==Syntax==
  
==General Procedure==
+
For single values from an XML node use the following syntax in the "Values" section of the [[Custom Field Type: Special - MS Word Merge|Word Merge custom field]]:
  
For single values use:
+
:''Mergefield''=@xml.''fieldname.sectionname.nodename''(''childnodename''.nodevalue)@;
project_budget=@xml.Submission Budget.Total-Expenses.total-exp.currency(total-expenses.nodevalue)@;
 
  
To display data in a table (dynamic number of rows) use the same syntax as used on a web page view ([[Custom_Field_Type:_Special_-_XML_Data]])
+
:'''Example:''' project_budget=@xml.Submission Budget.Total-Expenses.total-exp.currency(total-expenses.nodevalue)@;
and delimit the cells using pipes "|". Note that there is a | at the beginning and end of the row.
 
  
table_x=@xml.fieldname.sectionname.nodename[#|~childnodename.nodevalue~|~childnodename.nodevalue~|#]@
+
To display data in a table (dynamic number of rows) use the same syntax as used on a web page view ([[Custom Field Type: Special – XML Data]])
 +
and delimit the cells using pipes ("|"). Note that there is a pipe ("|") at the beginning and end of the row.
  
table_5=@xml.Submission Budget.Other-Grants.Funders[#|~Funder.nodevalue~|~currency(Amount.nodevalue)~|#]@;
+
:''table_x''=@xml.''fieldname.sectionname.nodename''[#|~''childnodename.nodevalue~|~childnodename.nodevalue''~|#]@;
  
This example would render in a table with two columns.  
+
:'''Example:''' table_5=@xml.Submission Budget.Other-Grants.Funders[#|~Funder.nodevalue~|~currency(Amount.nodevalue)~|#]@;
to specify the table use: "table_x =" where x is the table number as it appears in the template document.  
+
 
In the example above it's the fifth table in the document.  
+
*This example would render in a table with two columns.  
Each XML section must be displayed in a separate table.
+
*To specify the table use: "table_x =" where x is the table number as it appears in the template document.  
 +
*In the example above, the XML data will be merged into the fifth table in the Word document.  
 +
*Each XML section must be displayed in a separate table.
  
 
==See Also==
 
==See Also==
* [[Custom Field Type: Special - MS Word Merge]]
+
{{WordMergeLinks}}
* [[Custom_Field_Type:_Special_-_XML_Data]]
+
 
[[Category:Custom Fields]]
+
[[Category:Custom Fields]][[Category:XML]]

Latest revision as of 09:16, 3 June 2016

This article explains how to use the data stored within a SmartSimple XML field on a Word Merge document.

Word Merges can either draw in a single value from an XML "node" or the XML data can be displayed as a table.

Syntax

For single values from an XML node use the following syntax in the "Values" section of the Word Merge custom field:

Mergefield=@xml.fieldname.sectionname.nodename(childnodename.nodevalue)@;
Example: project_budget=@xml.Submission Budget.Total-Expenses.total-exp.currency(total-expenses.nodevalue)@;

To display data in a table (dynamic number of rows) use the same syntax as used on a web page view (Custom Field Type: Special – XML Data) and delimit the cells using pipes ("|"). Note that there is a pipe ("|") at the beginning and end of the row.

table_x=@xml.fieldname.sectionname.nodename[#|~childnodename.nodevalue~|~childnodename.nodevalue~|#]@;
Example: table_5=@xml.Submission Budget.Other-Grants.Funders[#|~Funder.nodevalue~|~currency(Amount.nodevalue)~|#]@;
  • This example would render in a table with two columns.
  • To specify the table use: "table_x =" where x is the table number as it appears in the template document.
  • In the example above, the XML data will be merged into the fifth table in the Word document.
  • Each XML section must be displayed in a separate table.

See Also