XML -> Java code generator.

Steve Muench smuench at us.oracle.com
Thu Jan 20 00:42:19 GMT 2000


Kevin,

The Oracle Class Generators for Java or C++ do this
for you. See the free download at:

http://technet.oracle.com/tech/xml/


_________________________________________________________
Steve Muench, Consulting Product Manager & XML Evangelist
Business Components for Java Development Team

----- Original Message -----
From: "Kevin A. Burton" <burton at relativity.yi.org>
To: <xml-dev at ic.ac.uk>
Sent: Wednesday, January 19, 2000 1:39 PM
Subject: XML -> Java code generator.


| So I am looking for a decent API that allows me to think of an XML
| document as a Java object... and not in terms of DOM/SAX and also allows
| me to abstract what XML parser that I am using so that it can be either
| XML4J/Xerces/etc.
|
| So for code like the following
|
|
| <!ELEMENT rss (channel)>
| <!ATTLIST rss
|           version     CDATA #REQUIRED> <!-- must be "0.91"> -->
|
| <!ELEMENT channel ( title | description )*>
| <!ELEMENT title (#PCDATA)>
| <!ELEMENT description (#PCDATA)>
|
|
| You would get
| ------------------
|
| package mypackage;
|
| import org.w3c.dom;
| import java.io.IOException;
|
| public class RSSDocument {
|
| public RSSDocument(String URL) throws IOException {
| file://parse out the dom and store it as a private
| file://member... impl here
| }
|
| public String getTitle() {
| file://impl here
| }
|
| public String getDescription() {
| file://impl here
| }
|
| public String getVersion() {
|
| }
|
| }
|
| Also, an element with an ATTLIST would be treated as members of a java
| object.
|
| Thoughts?  If I have to write my own code here it will be done as Open
| Source.
|
| Kevin
|
| --
| Kevin A Burton
| Senior Software Engineer
| Kendara Inc
| http://www.kendara.com
| Mobile:  408-910-6145
| Linux - The revolution will NOT be televised
|
| 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/ or CD-ROM/ISBN
981-02-3594-1
| Please note: New list subscriptions now closed in preparation for transfer
to OASIS.
|
|


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/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions now closed in preparation for transfer to OASIS.





More information about the Xml-dev mailing list