Page 1 of 1

Re: Need help with XML tag formatting to different style

Posted: Thu Aug 25, 2011 1:37 pm
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 :)

Posted: Thu Aug 25, 2011 3:21 pm
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)?

Posted: Thu Aug 25, 2011 3:41 pm
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

Need help with XML tag formatting to different style

Posted: Thu Aug 25, 2011 3:50 pm
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.