There is a requirement where I have to create a XML output file. While creating this file I have to conditionally filter out certain tags i.e. prevent the tags from being writtent into the XML file.
e.g.
<Department>
<DepartmentId>112</DepartmentId>
<EmployeeName>John</EmployeeName>
<EmployeeId>101</EmployeeName>
<EmployeeName>ZZ</EmployeeName>
<EmployeeId>00</EmployeeName>
</Department>
From the example it can be seen that a default employee 'ZZ' is being generated. I want to prevent the tag <EmployeeName>ZZ</EmployeeName> from being written into the output XML file. How can I acheive this. This there any setting in the XML output stage that can help me acheive this.
Preventing tags from being written into an XML file
Moderators: chulett, rschirm, roy
Your example is a little messed up. Did you actually mean something more like?
<Department>
<DepartmentId>112</DepartmentId>
<EmployeeName>John</EmployeeName>
<EmployeeId>101</EmployeeID>
<EmployeeName>ZZ</EmployeeName>
<EmployeeId>00</EmployeeId>
</Department>
And you need to suppress the 'ZZ' name or the '00' employee id?![Confused :?](./images/smilies/icon_confused.gif)
<Department>
<DepartmentId>112</DepartmentId>
<EmployeeName>John</EmployeeName>
<EmployeeId>101</EmployeeID>
<EmployeeName>ZZ</EmployeeName>
<EmployeeId>00</EmployeeId>
</Department>
And you need to suppress the 'ZZ' name or the '00' employee id?
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
...or alternatively you could also just make sure that the value for that column on that row is truly "null"...the default is to not create the element tag....
...of course, it's strange that the receiving application cares.....it should be able to handle empty elements.
Ernie
...of course, it's strange that the receiving application cares.....it should be able to handle empty elements.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>