xml tags not generating
Posted: Wed Aug 21, 2013 6:12 am
I have a requirement where an XML of the below format need to be generated.
<demands>
<demand>
<brand>ABC</brand>
<submittedby>KZK4164</submittedby>
<senddate>2013-08-14 09:42:44.353000</senddate>
<tasklistname>CONFIG_SEND</tasklistname>
<srcfilename>CONFIG-13859</srcfilename>
<uid>13859</uid>
<stores>
<store>008256</store>
<store>008563</store>
</stores>
</demand>
<demand>
<brand>ABC</brand>
<submittedby>KZK4164</submittedby>
<senddate>2013-08-14 09:42:44.353000</senddate>
<tasklistname>CONFIG_CANCEL</tasklistname>
<uid>13859</uid>
<stores>
<store>008233</store>
<store>008444</store>
<store>008454</store>
<store>008463</store>
</stores>
</demands>
I used the STORE number as a key in the XML input and have generated each repeating demand item by applying Trigger to the UID element. The only problem I am facing now is with the start and end tag <demands></demands> . If I am specifying the XPath like /demands/demand/(the corresponding element) then I get the <demands></demands> combination getting repeated for each demand item. I only need this <demands></demands> only once in my file.
To achieve this I passed the input through another XML output stage but I got a truncated output with only a very few records.
<demands>
<demand>
<brand>ABC</brand>
<submittedby>KZK4164</submittedby>
<senddate>2013-08-14 09:42:44.353000</senddate>
<tasklistname>CONFIG_SEND</tasklistname>
<srcfilename>CONFIG-13859</srcfilename>
<uid>13859</uid>
<stores>
<store>008256</store>
<store>008563</store>
</stores>
</demand>
<demand>
<brand>ABC</brand>
<submittedby>KZK4164</submittedby>
<senddate>2013-08-14 09:42:44.353000</senddate>
<tasklistname>CONFIG_CANCEL</tasklistname>
<uid>13859</uid>
<stores>
<store>008233</store>
<store>008444</store>
<store>008454</store>
<store>008463</store>
</stores>
</demands>
I used the STORE number as a key in the XML input and have generated each repeating demand item by applying Trigger to the UID element. The only problem I am facing now is with the start and end tag <demands></demands> . If I am specifying the XPath like /demands/demand/(the corresponding element) then I get the <demands></demands> combination getting repeated for each demand item. I only need this <demands></demands> only once in my file.
To achieve this I passed the input through another XML output stage but I got a truncated output with only a very few records.