Two Laptop Bag*
The moose likes XML and Related Technologies and the fly likes Looking for ideas on best way to do this with XML.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Looking for ideas on best way to do this with XML...." Watch "Looking for ideas on best way to do this with XML...." New topic
Author

Looking for ideas on best way to do this with XML....

Mike Kopack
Greenhorn

Joined: Jul 13, 2005
Posts: 6
Hey gang,

Part of my project is responsible for reading in an XML document containing some high-level information used in aircraft mission planning. It needs to take that high-level info and produce a more detailed mission plan XML document. For instance, the input document might contain information like "Takeoff point", "loiter area", "landing point" as elements containing user input parameters in the document. The output would contain similar information, but broken down and mapped to more specific detailed information such as flight waypoints and such.

I know how to process Java documents using both DOM and SAX (the built in packages in Java 1.4+). Currently I don't have any schemas for these documents, but I can make those if needed.

I'm just wondering if anyone has some ideas on a straightforward way to do such translations. I'm not expecting to do seriously complicated conversions. Every node in the source plan document has a "type" attribute in it, and in pretty much all cases the source node will map to 1-n more detailed destination nodes with a very small set of type mappings between them.

Any ideas how I could quickly do this? I started looking at JAXB but think it might be overkill. XSLT sounds like it could be helpful, but I know nothing about it.

Ideas?

--Mike
Gernot Greimler
Greenhorn

Joined: Sep 08, 2005
Posts: 6
if you just want to map data from one XML to another XML, XSLT is the key.
I work with Altova MapForce to "map" the Data from one XML Scheme to the other and don't have to write a single line of code.
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
XSLT is definitely the way to go!!!

Best tutorials
http://www.w3schools.com
http://www.zvon.org
http://bobcat.webappcabaret.net/javachina/faq/xslt_01.htm
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Looking for ideas on best way to do this with XML....