AnsweredAssumed Answered

Determining if an XML tag exists, even if empty

Question asked by katie.e.jones316496 on Mar 29, 2018
Latest reply on Apr 3, 2018 by Srinivas Chandrakanth Vangari

I have an XML file with one of the below options for content. 

 

<Request>
<WriteRequest>
<Environment>Dev</Environment>
<Input></Input>
<System>XXXXX</System>
<Template>Test</Template>
</WriteRequest>
<Document>
</Document>
</Request>

 

<Request>
<WriteRequest>
<Environment>Dev</Environment>
<System>XXXXX</System>
<Template>Test</Template>
</WriteRequest>
<Document>
</Document>
</Request>

 

The only difference is that one contains an <Input> tag that has no value and the other one doesn't contain an <Input> tag.  What is the most efficient way to validate that the XML contains an <Input> tag, regardless if it is empty or not?  In my Boomi process I populate the value of this tag, so I just need it to be available from the input request, but it can be blank or contain data.  However, if the tag is missing completely, I need to throw an error.  I tried this Business Rules shape, hoping it would validate that the <Input> tag exists, and that the value can be empty or not empty.  However, if the tag is missing, it is still validating as true/accepted on the "Input Tag? is empty" condition.

 

Input document:

Shape Logs:

 

How would I go about validating that the <Input> tag exists, and allow it to have no value or some value?

 

Thank you.

Outcomes