XML Output Stage - Combine Attributes

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sohasaid
Premium Member
Premium Member
Posts: 115
Joined: Tue May 20, 2008 3:02 am
Location: Cairo, Egypt

XML Output Stage - Combine Attributes

Post by sohasaid »

Hi,

I can't generate XML file with the below format.

Code: Select all

  <ns2:SyncRec>
    <ns2:SyncInfo>
      <ns2:Details>
        <ns2:Rec>
          <bas:Id>
TEST
          </bas:Id>
        </ns2:Rec>
      </ns2:Details>
    </ns2:SyncInfo>
  </ns2:SyncRec>
</SyncGetRsType>

  <ns2:SyncRec>
    <ns2:SyncInfo>
      <ns2:Details>
        <ns2:Rec>
          <bas:Id>
TEST
          </bas:Id>
        </ns2:Rec>
      </ns2:Details>
    </ns2:SyncInfo>
  </ns2:SyncRec>
</SyncGetRsType>
Input is one column dataset:
----------------------------
ID
--
TEST
TEST


The best I can get from the XML output stage is the following:

Code: Select all

  <ns2:SyncRec>
    <ns2:SyncInfo>
      <ns2:Details>
        <ns2:Rec>
          <bas:Id>
TEST
          </bas:Id>
          <bas:Id>
TEST
          </bas:Id>
        </ns2:Rec>
      </ns2:Details>
    </ns2:SyncInfo>
  </ns2:SyncRec>
</SyncGetRsType>
Description in clumn definition is:
/SyncGetRsType/ns2:SyncRec/ns2:SyncInfo/ns2:Details/ns2:Rec/bas:Id/text()

As you can see, it combines some attributes but the requirements need all attributes to be there at every single line.

Appreciate your support.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

is this a quick test? ..will the real example have valid and unique identifiers for all of the higher level nodes?

If so, it's likely that this data is not really valid for test purposes. You may need to have something that identifies more uniqueness for each of the nodes along the way...and that may exist in your real-life data set.

If not, you may need to create some counters that provide uniqueness and include them in the xml, but again, it depends on the nature of your input data.

Another thought for quick testing is to avoid the "aggregate" check box in the Transformation settings on the output link of your xmlOutput job.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply