Guest_imported
New member
- Jan 1, 1970
- 0
Hi gurus
I have a requirement of getting data from Database and then packing it in xml and then send it as a message. Now I can think of two xml structures to do this:
1) This structure is like
<tablename><row><col1>value</col1></row><row><col2>value</col2></row></tablename>
The advantage with this approach is I have values of a particular row together. But disadvantages are, it is difficult to get a column value across all rows and also the column names get repeated across all rows.
2) In this approach the xml would typically look like
<tablename><col1><row>value</row><row>value</row></col2><col1><row>value</row><row>value</row></col2></tablename>
This solves the problem of column names getting repeated vis-a-vis approach one, but again retreiving all the columns of a given row is going to be cumbersome.
I wanted to know if there is any better approach other than these two. If yes, I would like to know that. If no, I would like to know which one of these approaches is good and why.
Thanks in Advance
Sudheer
I have a requirement of getting data from Database and then packing it in xml and then send it as a message. Now I can think of two xml structures to do this:
1) This structure is like
<tablename><row><col1>value</col1></row><row><col2>value</col2></row></tablename>
The advantage with this approach is I have values of a particular row together. But disadvantages are, it is difficult to get a column value across all rows and also the column names get repeated across all rows.
2) In this approach the xml would typically look like
<tablename><col1><row>value</row><row>value</row></col2><col1><row>value</row><row>value</row></col2></tablename>
This solves the problem of column names getting repeated vis-a-vis approach one, but again retreiving all the columns of a given row is going to be cumbersome.
I wanted to know if there is any better approach other than these two. If yes, I would like to know that. If no, I would like to know which one of these approaches is good and why.
Thanks in Advance
Sudheer