aspose file tools*
The moose likes Web Services and the fly likes transfer  to XML format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "transfer  to XML format" Watch "transfer  to XML format" New topic
Author

transfer to XML format

sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
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

Joined: Aug 10, 2001
Posts: 3879
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
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

Joined: Aug 10, 2001
Posts: 3879
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

Joined: Nov 21, 2001
Posts: 104
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


SCJP 1.4/SCBCD/SCWCD<br />MCSE<br />IBM professional XML Developer<br />SAP certified Development Consultant (NetWeaver portal and Web JavaApplication)
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
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

Joined: Sep 06, 2000
Posts: 42
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

Joined: Sep 06, 2000
Posts: 42
Sarah specifially look out for "Configure SQL XML Support in IIS" for SQL Server and go thr its help...
njoy
Badal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: transfer to XML format
 
Similar Threads
XML-why do we need it & where is it being used??
inserting xml strings
XML to database using java
dbgrid
retrieve blob data from mysql using jsp