Parsing XML for direct use by programs
John Wilson
tug at wilson.co.uk
Wed Nov 4 16:15:29 GMT 1998
Programs that consume XML generally have to use a two stage process:
1/ Parse the XML
2/ Create new objects to represent the data in the document
(Here I'm thinking of things like EDI applications rather than of XML
browsers. In these cases I have elements which represent dates, amounts of
money, par number, etc. and I need to turn them into the appropriate
internal data structures before my program can process them.)
I have lots of support for step 1 but little or no support for step 2 (I'll
address Bill la Forge's Coins system latter)
What I think I would find helpful is a system which would let me describe
how an XML document which corresponds to a given DTD be converted into an
instances of a particular objects in my particular programming language. Of,
course I'd like to describe this in XML!
To take a concrete example:
There are several ways of expressing a date in various DTDs in use now.
In my Java program I want to deal with instances of java.util.Date.
I don't want to encumber my program with all the hand crafted tedious detail
of turning the XML element into an instance of java.util.Date by hand.
I do want a standard package that reads a DTD an DTD->Java Object mapping
description and an XML document and spits out the object tree that is
understood by my program, not a DOM tree.
Now, as I understand it, Coins can sort of do this but the designer of the
DTD has really to take Coins into account at the beginning. This isn't what
I want to do at all. I want the same DTD to be combined with different
mapping descriptions to produce different object trees and I want different
DTDs to be combined with different mapping descriptions to provide the same
object tree.
Is anybody working on this?
Is it feasible?
Is it useful?
John Wilson
The Wilson Partnership
5 Market Hill, Whitchurch, Aylesbury, Bucks HP22 4JB, UK
+44 1296 641072, +44 976 611010(mobile), +44 1296 641874(fax)
Mailto: tug at wilson.co.uk
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list