Hello,
I'm trying to generate document from XML code, I'm able to get the expected data if the data was single dictionary, but i have a requirement to generate document for a list of data items.
I have already seen many of the community posts, I followed the same pattern to generate doc using xml code, but I'm getting an error, says that syntax error in template.
Please let me know what i have done wrong here.
ERROR: Syntax error in template "fr.opensagres.xdocreport.document.docx.DocxReport@3ad77c4f!word/document.xml" in line 4, column 1468:Encountered "\" \\b @before-row</w:t></w:r><w:r><w:rPr><w:noProof/></w:rPr><w:t>${d.@name}</w:t></w:r><w:r><w:rPr><w:noProof/></w:rPr><w:t>[/#list] \\b @after-row</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"", but was expecting pattern: <ID>
I have shared the XML code and the template as well.
a!localVariables( local!data: { { name: "Sam", branch: "CSE", rollNum: "12301" }, { name: "John", branch: "ECE", rollNum: "12302" } }, concat( "<info>", a!forEach( items: local!data, expression: "<rowvalues name = " & "'" & fv!item.name & "'" & " branch= " & "'" & fv!item.branch & "'" & " rollNum= " & "'" & fv!item.rollNum & "'" & " />" ), "</info>" ) )
Thank you
Discussion posts and replies are publicly visible
Aren't you missing a closing "]" in the expression used in the template?
@before-row«[#list doc.info.rowvalues as»«${d.@name}»@after-row«[/#list]»
No, i didn't miss it, i have attached the template if you are willing to see, you can see
I checked it in the template attached... Could you please check it again?
Thank you. It is working now