Page 1 of 1

xml output

Posted: Tue Jan 25, 2011 6:29 am
by vasubabu
Hi,

I am creating the xml file using the xml output stage.But in my source some of the fields have the NULL values.After creation of the xml file ,i am not finding the closed tag to those columns which are NULLs in source side.
I have checked the option "open and close tags" in transformation setytings of XML output stage.Still i am not getting the clsed tag in my final XML output file.

Got the output as :-
<CustDetails>
<CIFId>id123</CIFId>
<CustCompTyp />
<CustLang />
</CustDetails>
Please suggest.

Posted: Tue Jan 25, 2011 7:26 am
by eostic
I haven't tested all the variations with nulls and that setting, but from an xml perspective, it doesn't matter...

<CustLang/> and <CustLang></CustLang> are equivalent.

...provided however, that the person/application who is reading your document understands xml, and is using a normal xml parser. You should be fine.

Ernie

Posted: Tue Jan 25, 2011 7:30 am
by chulett
You have a closing tag, a valid one but just not the one you think it needs to be. You can change the option from <tag/> to <tag></tag> but they are equivalent.

Posted: Tue Jan 25, 2011 10:59 am
by vasubabu
Hi,

we are sending this XML document to downstream systems.They need in the format like <tag></tag>.
As you said there is an option to change it,can you guide me where can i change the option in datastage to get this kind of output.

Posted: Tue Jan 25, 2011 11:26 am
by chulett
I don't have any kind of access but it shouldn't be all that hard to find in the stage... should mention something about 'closing tags'.

Posted: Thu Jan 27, 2011 12:21 am
by vasubabu
chulett wrote:I don't have any kind of access but it shouldn't be all that hard to find in the stage... should mention something about 'closing tags'.
Yes.there is an option like "open and close tags" in transformation settings of XML output stage.still i did not get the open and closed tags for NULL value columns.

Posted: Thu Jan 27, 2011 12:51 am
by myukassign
Normally all XML parser's can read an empty tag in the format <empty/> which is equalent to <empty></empty>.

May I know the files you produced, are you viewing through any browser like internet explorer / mozilla etc.. if yes then it will by default show you in the format <empty/> but if you open the same file using notepad, you should be able to see the same in <empty></empty> format.

Please check that and let us know what you see in the file when you open it through the notepad.

Note. All parsers whether it is custom made / product based should follow W3C xml 1.0 standard. According to the standard the parser should read <empty/> and <empty> </empty> in the same way. Thanks.

Posted: Fri Jan 28, 2011 4:17 am
by vasubabu
myukassign wrote:Normally all XML parser's can read an empty tag in the format <empty/> which is equalent to <empty></empty>.

May I know the files you produced, are you viewing through any browser like internet explorer / mozilla etc.. if yes then it will by default show you in the format <empty/> but if you open the same file using notepad, you should be able to see the same in <empty></empty> format.

Please check that and let us know what you see in the file when you open it through the notepad.

Note. All parsers whether it is custom made / product based should follow W3C xml 1.0 standard. According to the standard the parser should read <empty/> and <empty> </empty> in the same way. Thanks.
Thanks for the information.
I have passed the same to users and waiting for the reply.

empty tags

Posted: Fri Jan 28, 2011 6:12 am
by Sreenivasulu
myukassign wrote:Normally all XML parser's can read an empty tag in the format <empty/> which is equalent to <empty></empty>.

May I know the files you produced, are you viewing through any browser like internet explorer / mozilla etc.. if yes then it will by default show you in the format <empty/> but if you open the same file using notepad, you should be able to see the same in <empty></empty> format.

Please check that and let us know what you see in the file when you open it through the notepad.

Note. All parsers whether it is custom made / product based should follow W3C xml 1.0 standard. According to the standard the parser should read <empty/> and <empty> </empty> in the same way. Thanks.

You are right but its <empty/> in the text editor then it shows <empty/> in browsers (NOT <empty> </empty> ). Its funny since i though browsers just show the text in the form of a tree (using a dtd)

Regards
Sreeni

Posted: Fri Jan 28, 2011 7:53 am
by chulett
Interesting... never knew that a browser would show something like an empty tag differently than it was in the source but just confirmed the behaviour for myself. But then it was never my tool of choice to check the validity of xml.
Normally all XML parser's can read an empty tag in the format <empty/> which is equalent to <empty></empty>.
Third time that little tidbit has been mentioned in this thread. :wink:

Posted: Fri Jan 28, 2011 9:02 am
by Sreenivasulu
I found that generally the developers use 'xmleditors' but the 'operations/users' use browsers to look into the contents of the xml

Regards
Sreeni