IBM Support

XPath - how to create attributes for elements when the element contains no text.

Troubleshooting


Problem

XPath - how to create attributes for elements when the element contains no text.

Symptom

The goal is to create 12 nodes in  ProcessData, each with an attribute containing a month of the year. The previous node is being overwritten by the node that follows it. The assign statements have the append property set to true. When the BP completes, the only node that is present is the one for December. January through November are overwritten. Below is a portion of the BP and along with a sample of the desired output.

<process name="test_convert_num_Month_2_Text">
<sequence name="Sequence Start">
<assign name="Assign" to="/Month/month/@monthnum" from="'January'" append="true"></assign</span>
<assign name="Assign" to="/Month/month/@monthnum" from="'February'" append="true"></assign>

<assign name="Assign" to="/Month/month/@monthnum" from="'March'" append="true"></assign>
<assign name="Assign" to="/Month/month/@monthnum" from="'April'" append="true"></assign> 
</sequence>
</process>

This is an example of how the file should look:

<ProcessData>
<Month>
<month monthnum="January"/>
<month monthnum="February"/>
             :
<month monthnum="November"/>
<month monthnum="December"/>
</Month>
</ProcessData>

Error Message

 No errors, but the ProcessData does not contain the desired output.

[{"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Extensions","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}},{"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Adapters","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Historical Number

NFX9908

Document Information

Modified date:
11 February 2020

UID

swg21558138