Need help with XML tag formatting to different style

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mac4rfree85
Participant
Posts: 126
Joined: Thu Jul 01, 2010 11:39 pm

Re: Need help with XML tag formatting to different style

Post by mac4rfree85 »

I am also new to XML... I don know whether we can create it. But yes we can read it.
emp_cd,last_name,first_nam are called attributes.
They can be read it using XMLReader.
In derivation part, you need to mention the XPath of them which will be

Code: Select all

/empload/entry/@emp_Cd
/empload/entry/@first_nam
/empload/entry/@last_name
Let me know if i made myself clear. I can help you in reading XML :)
Mac4rfree
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

XML is by its very nature free format, so I ask "why bother"?

There are lots of XML-prettifying tools out there, so why insist on using the wrong tool (DataStage)?
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 »

...and it is a best practice not to include CRLF's or extra spacing..it's just "noise" making your xml document larger. Nowadays every decent browser, editor and tool knows how to format the document for viewing. Specify NO formatting, regardless of what tooling you choose to write your xml.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
satkolli
Participant
Posts: 14
Joined: Thu Jun 05, 2008 12:26 pm

Need help with XML tag formatting to different style

Post by satkolli »

Thanks a lot! The '@' in the XPath was what I was missing. This worked great to create the XML as expected. I have always created/read XMLs in the standard format and never did one with this style. Didnt know that was a style of XMLs.

Ray, that was what I said... but clients being clients wanted it that specific way only. Even though my format was basically the same.

Eostic... I usually create the XMLs with no CR/LF to save space.... I just wrote it that way in the post so it was easy to view.

Thanks everyone for the replies... was interesting to know about the different styles of the XML and how to handle them. Guess I was stuck in the old XML style and need to update myself.
Post Reply