Hi community,
I'm using Advanced Document Templating plugin for a document generation where i have multiple chapters, and in each chapter i have have a conditional statement that if in the passed list are values then show a table else show a text "No data".
This a similar structure to the one that i'm using
<document> <chapter1> <line col1="My text col1" col2="My text col2"/> <line col1="My text col1" col2="My text col2"/> <line col1="My text col1" col2="My text col2"/> </chapter1> <chapter2> <line col1="My text col1" col2="My text col2"/> <line col1="My text col1" col2="My text col2"/> <line col1="My text col1" col2="My text col2"/> </chapter2> </document>
The way that i'm implementing it is like the following in the document.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oel="http://schemas.microsoft.com/office/2019/extlst" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14"> <w:body> <w:p w14:paraId="50A71A47" w14:textId="2386750B" w:rsidR="006A60FB" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:pStyle w:val="Heading1" /> <w:rPr> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:lang w:val="en-US" /> </w:rPr> <w:t>Chapter 1</w:t> </w:r> </w:p> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> <w:tag w:val="@before-block[#if doc.document.chapter1?has_content && (doc.document.chapter1.line?size >0)]" /> <w:id w:val="604079035" /> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> <w:tbl> <w:tblPr> <w:tblStyle w:val="TableGrid" /> <w:tblW w:w="0" w:type="auto" /> <w:tblLook w:val="0620" w:firstRow="1" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="1" w:noVBand="1" /> </w:tblPr> <w:tblGrid> <w:gridCol w:w="4508" /> <w:gridCol w:w="4508" /> </w:tblGrid> <w:tr w:rsidR="00924927" w14:paraId="57635255" w14:textId="77777777" w:rsidTr="00924927"> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="59800F16" w14:textId="147FDE08" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00924927"> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>Col 1</w:t> </w:r> </w:p> </w:tc> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="20CF9A68" w14:textId="773C80D7" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00924927"> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>Col 2</w:t> </w:r> </w:p> </w:tc> </w:tr> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> <w:tag w:val="@before-row[#list doc.document.chapter1.line as line]" /> <w:id w:val="604079035" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent> <w:p w14:paraId="45F077BF" w14:textId="465EF814" w:rsidR="00E75BA5" w:rsidRPr="00E75BA5" w:rsidRDefault="00E75BA5" w:rsidP="002D2BAB"> <w:pPr> <w:autoSpaceDE w:val="0" /> <w:autoSpaceDN w:val="0" /> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00E75BA5"> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> </w:r> </w:p> </w:sdtContent> </w:sdt> <w:tr w:rsidR="00924927" w14:paraId="41BE5EED" w14:textId="77777777" w:rsidTr="00924927"> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="694091C5" w14:textId="7E523700" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>${line.@col1}</w:t> </w:r> </w:p> </w:tc> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="6D250F07" w14:textId="19834333" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>${line.@col2}</w:t> </w:r> </w:p> </w:tc> </w:tr> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> <w:tag w:val="@after-row[/#list]" /> <w:id w:val="604079035" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> </w:tbl> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> <w:tag w:val="@before-block[#else]" /> <w:id w:val="-497119726" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> <w:p w14:paraId="5A0399FC" w14:textId="18738795" w:rsidR="00E75BA5" w:rsidRPr="00E75BA5" w:rsidRDefault="00E75BA5" w:rsidP="002D2BAB"> <w:pPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00E75BA5"> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> <w:t>No data.</w:t> </w:r> </w:p> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> <w:tag w:val="@after-row[/#if]" /> <w:id w:val="-508678399" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> <w:p w14:paraId="35BF27D0" w14:textId="2EBBC6D4" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:rPr> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> </w:p> <w:p w14:paraId="06EB09B3" w14:textId="15FB34C3" w:rsidR="00924927" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:pStyle w:val="Heading1" /> <w:rPr> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:lang w:val="en-US" /> </w:rPr> <w:t>Chapter 2</w:t> </w:r> </w:p> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> <w:tag w:val="@before-block[#if doc.document.chapter2?has_content && (doc.document.chapter2.line?size >0)]" /> <w:id w:val="604079035" /> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> <w:tbl> <w:tblPr> <w:tblStyle w:val="TableGrid" /> <w:tblW w:w="0" w:type="auto" /> <w:tblLook w:val="0620" w:firstRow="1" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="1" w:noVBand="1" /> </w:tblPr> <w:tblGrid> <w:gridCol w:w="4508" /> <w:gridCol w:w="4508" /> </w:tblGrid> <w:tr w:rsidR="00924927" w14:paraId="19C61416" w14:textId="77777777" w:rsidTr="00B5662E"> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="4D685702" w14:textId="77777777" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00B5662E"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00924927"> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>Col 1</w:t> </w:r> </w:p> </w:tc> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="36DEBB59" w14:textId="77777777" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00B5662E"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00924927"> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>Col 2</w:t> </w:r> </w:p> </w:tc> </w:tr> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> <w:tag w:val="@before-row[#list doc.document.chapter2.line as line]" /> <w:id w:val="604079035" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent> <w:p w14:paraId="45F077BF" w14:textId="465EF814" w:rsidR="00E75BA5" w:rsidRPr="00E75BA5" w:rsidRDefault="00E75BA5" w:rsidP="002D2BAB"> <w:pPr> <w:autoSpaceDE w:val="0" /> <w:autoSpaceDN w:val="0" /> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00E75BA5"> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> </w:r> </w:p> </w:sdtContent> </w:sdt> <w:tr w:rsidR="00924927" w14:paraId="788BD972" w14:textId="77777777" w:rsidTr="00B5662E"> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="5EFD3FCB" w14:textId="77777777" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00B5662E"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>${line.@col1}</w:t> </w:r> </w:p> </w:tc> <w:tc> <w:tcPr> <w:tcW w:w="4508" w:type="dxa" /> </w:tcPr> <w:p w14:paraId="34854A9B" w14:textId="77777777" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00B5662E"> <w:pPr> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:b /> <w:bCs /> <w:lang w:val="en-US" /> </w:rPr> <w:t>${line.@col2}</w:t> </w:r> </w:p> </w:tc> </w:tr> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial" /> </w:rPr> <w:tag w:val="@after-row[/#list]" /> <w:id w:val="604079035" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> </w:tbl> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> <w:tag w:val="@before-block[#else]" /> <w:id w:val="-497119726" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> <w:p w14:paraId="5A0399FC" w14:textId="18738795" w:rsidR="00E75BA5" w:rsidRPr="00E75BA5" w:rsidRDefault="00E75BA5" w:rsidP="002D2BAB"> <w:pPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> </w:pPr> <w:r w:rsidRPr="00E75BA5"> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> <w:t>No data.</w:t> </w:r> </w:p> <w:sdt> <w:sdtPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" /> </w:rPr> <w:tag w:val="@after-row[/#if]" /> <w:id w:val="-508678399" /> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440" /> </w:placeholder> <w:text /> </w:sdtPr> <w:sdtContent /> </w:sdt> <w:p w14:paraId="32AA616D" w14:textId="77777777" w:rsidR="00924927" w:rsidRPr="00924927" w:rsidRDefault="00924927" w:rsidP="00924927"> <w:pPr> <w:rPr> <w:lang w:val="en-US" /> </w:rPr> </w:pPr> </w:p> <w:sectPr w:rsidR="00924927" w:rsidRPr="00924927"> <w:pgSz w:w="11906" w:h="16838" /> <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0" /> <w:cols w:space="708" /> <w:docGrid w:linePitch="360" /> </w:sectPr> </w:body>
The output file shows the table correctly and no issues here, my issue with the file is that i can still see the placeholders for the conditionals and loop
Also if i do any changes to the file and save them then i cannot open the file anymore.Does anyone have any feedback that can be done to remove the field placeholders and also give the user the ability to edit the file without breaking it?
Discussion posts and replies are publicly visible