Hierarchy stage <element/> tags

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
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

Hierarchy stage <element/> tags

Post by sainath »

Hi

In hierarchy stage where can I select the format of the output


I am getting the following one if input is null


<element-name/>

but I want

<element_name>/<element-name>

I tried to change in XSD no luck

please help
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

The two are equivalent, assuming you mean <element> </element>
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

Post by sainath »

HI

I mean the below format.how can I achieve this using hierarchy stage
<element> </element> ..


thks

Sainath
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Don't try to force the stage (or any stage) to do what it's not designed to do. There are plenty of XML formatters out there; many of them are free. Use the right tool for the job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

This is a good discussion....

XML, as a standard ,supports two similar methods for indicating an "empty" element.

<element/>

and

<element></element>

Both are entirely equivalent --- the mean the same thing. Some have argued in the past that one is more readable than the other...and certainly, the top one is a lot more efficient, making the payloads MUCH smaller, in large documents with hundreds of elements and the potential that a large majority of them are empty.

But --- either way, a valid xml parser on the receiving end should NOT care. ...and if it does, it is time to have it updated. These debates about empty elements were very active and valid --- in 2001....but now? Hardly.

That being said, the xmlOutput Stage provides the option (it was written in 2001) for your choice of empty element. The Hierarchical Stage gives you the option of whether you want the element at all (if null, you can choose to have no element sent to the final document). [xmlOutput can do this too, but it is a matter of how you specify nullability as opposed to an option in the GUI].

Bottom line -- the receiver should be able to handle this entirely valid xml construct, regardless of how it is output...

If not, and your xml is fairly simple, you could use the older xmlOutput stage to accomplish what you are looking for.

Ernie
Ernie Ostic

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