Changes

Jump to: navigation, search

Including XML on an MS Word Merge Document

339 bytes added, 13:16, 3 June 2016
no edit summary
This article explain explains how to use the data stored within a SmartSimple [[SmartSimpleCustom Field Type: Special - XML Data|XML field]] 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:project_budget''Mergefield''=@xml.Submission Budget''fieldname.Total-Expensessectionname.total-exp.currencynodename''(total-expenses''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_'''Example:''' project_budget=@xml.Submission Budget.Total-Expenses.total-_XML_Data]]) and delimit the cells using pipes "|"exp. Note that there is a | at the beginning and end of the rowcurrency(total-expenses.nodevalue)@;
table_x=@xml.fieldname.sectionname.nodenameTo 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 ("|~childnodename").nodevalue~Note that there is a pipe ("|~childnodename") at the beginning and end of the row.nodevalue~|#]@
table_5:''table_x''=@xml.Submission Budget''fieldname.Other-Grantssectionname.Fundersnodename''[#|~Funder''childnodename.nodevalue~|~currency(Amountchildnodename.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 *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 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==
* [[Custom Field Type: Special - MS Word Merge]]{{WordMergeLinks}} * [[Custom_Field_TypeCategory:_Special_-_XML_DataCustom Fields]][[Category:Custom FieldsXML]]
Smartstaff, administrator
4,478
edits

Navigation menu