Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

transfer to XML format

 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have two questions:
1.
What I know is that DOM and SAX can be
used as the parser of XML. If I grab
one row of the data from the database
and want to transfer this row of data
into XML format, is there any way to do
it (not manually)?
2.
When transfer the data in database to XML,
How to make the following choice:
Modeling the column to Element
Modeling the column to Attribute
Thanks in advance,
Sarah
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sarah Marsh:
Hello All,
I have two questions:
1.
What I know is that DOM and SAX can be
used as the parser of XML. If I grab
one row of the data from the database
and want to transfer this row of data
into XML format, is there any way to do
it (not manually)?
2.
When transfer the data in database to XML,
How to make the following choice:
Modeling the column to Element
Modeling the column to Attribute
Thanks in advance,
Sarah

(1) Your best bet is to buy a tool to do this for you. For instance, Websphere Studio Application Developer (WSAD) contains tools to map from a RDB schema to an XML schema or DTD. You can download a trial version of that here: http://www-3.ibm.com/software/ad/studioappdev/
There are other tools from other vendors (Oracle, etc.) to do the same thing.
(2) I prefer to map columns to elements, but that's personal preference My reason is that it's easier to map foreign-key kind of relationships as intra-element relationships that way.
Kyle
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, Kyle.
But as for the first question, I'd like to make it clear here. what I was aking is:
How can transfer the data queried from database
to XML file automatically?
I'm not asking map from a RDB schema to an XML
schema or DTD.
Kyle, have some ideas on this?
Thanks,
Sarah
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't ask that question but you should have. There is no magical mapping from XML to an RDB. First of all you have to define how to map your RDB schema to an XML schema or DTD and then you have to have code that uses that mapping to convert from one to the other. That's what WSAD does for you -- it takes the mapping and generates code to do the transformation.
There is no free lunch. Someone (or some tool) has to write the code to do this. I'm telling you where to find tools that do this for you.
Kyle
 
Roy Huang
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sarah,
maybe U can try with the IBM XML-Web service development toolkit. As I remember it offers this kind of the XML tags to DTD mapping.
U can Have a try of this.
from IBM developerwork, U can download this toolkit, a little bit large: 90M bytes.
Hope it works,
Roy
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, that wasn't in the toolkit, it was the "Web Services and XML Development Environment" -- which graduated from Alphaworks to become WSAD (WebSphere Studio Application Developer).
Kyle
 
Badal Kotecha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
comeon guys...
sarah nowadays RDBMS are supporting in built XML support...
I know that about SQL Server wherein u can configure your server with IIS (by creating some virtual directory and following the steps mentioned in SQL Servers manual).
By doing this u can generate XML output of the query ....just by mentioning the query (select query) as one of the parameter in the URL poiting that virtual directory... rest is taken care by IIS and ur database...
check out for other databases... I think it may have some XML Support....
Check this out
sarah i have added u in my frens list... dont mind...
KIT
Badal
 
Badal Kotecha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sarah specifially look out for "Configure SQL XML Support in IIS" for SQL Server and go thr its help...
njoy
Badal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic