[jdom-interest] XSD->XML

Yoichi Takayama yoichi at webmcq.com
Wed Apr 11 23:47:14 PDT 2001

Dear Warner,

I am still very new to XML.

I would like to be able to dynamically add/delete XML element from my JDOM 
tree.  Of course, this has to be done under the constraints imposed by the 
schema file.

I would like to be able to represent the current structure and values held 
by an XML JDOM in a GUI and to see what elements/attributes I can add or 
delete, and I want the XML Element/Attribute objects to do the field type 
check and value range check automatically for me and so on.

Can we implement <sequence> <complexType> <restriction> <enumeration> etc. 
Java Classes and extends JDOM Element class to achieve this???  So, it is a 
sort of XML/XSD JDOM, in which each element knows its options/restrictions 
set in the underlying XSD file.  Elements yet to be created in the XML tree 
must have some places to stay in the tree in this case, or they should be 
read from the schema file as they are needed.

I could have the schema JDOM tree as a shadow tree (template of the XML 
tree?) for the "front" XML tree (instance of the schema?) to do the check 
on the fly.  In that case, there is no need to extend the JDOM Element 
classes, but then how should we implement the interaction between the 
two?  Is there a good programming or object model for this?

I tried IBM's facility to auto-generate Java Classes representing XML from 
DTD or Schema, but it has no value constraints built into these 
classes.  Also, at present, the facility is all hard-coded in terms of the 
DOM tree by using these "IBMXMLElement" Classes, and there is no transfer 
of information about what class(es) can be added/deleted.  The last two 
points can be done by writing up my own code to use these IBMXMLElement 
classes, but the point here is how to automate such a task.

Any good idea?


Warner R. Onstine mailto:warner at warneronstine.com
Thu, 22 Mar 2001 13:30:08 -0800
·       Previous message: ·     FW: [jdom-interest] Newbie: Schema 
validation of a document being built via JDOM
·       Next message: · [jdom-interest] Why should I have to detach()?
·       Messages sorted by: ·   [ date ] ·      [ thread ] ·    [ subject ] 
·   [ author ]

I would love to see something like this for both DTD and Schema. If not an
integrated part it would be nice to see something in jdom/contrib for this.


----- Original Message -----
From: "Kevin Baynes" <kbaynes at renex.com>
To: "Jdom-Interest" <jdom-interest at jdom.org>
Sent: Thursday, March 22, 2001 8:05 AM
Subject: FW: [jdom-interest] Newbie: Schema validation of a document being
built via JDOM

 > I'm just forwarding this to the group.
 > -----Original Message-----
 > From: Carsten Karkola [mailto:karkola at rcs.urz.tu-dresden.de]
 > Sent: Thursday, March 22, 2001 2:31 AM
 > To: Kevin Baynes
 > Subject: RE: [jdom-interest] Newbie: Schema validation of a document
 > being built via JDOM
 > Maybe it could also be interesting to get all possible childs of an xml-
 > node using the schema information (like psgml in emacs it does with
 > a dtd).
 > My scenario would be:
 > I can ask an List element.getValidContent() and i can compare the
 > type/name of the element/attribute, which I try to insert in my
 > document against the result of the above method.
 > I think this is also helpfull in a GUI. I can fill a popupmenu with the
 > reuslts build on the schema information and can avoid the insertion
 > of wrong elements.
 > In an second part I have to validate the document to find out missing
 > elements/attributes via Document.validate().
 > regards, carsten
 > ==================================================
 > ==
 > ==    Dipl.-Ing. Carsten Karkola
 > ==
 > ==    TU Dresden - Dez.4; SG 4.2
 > ==
 > ==      Tel.:  +49 351 463 7817
 > ==       Fax:  +49 351 463 7179
 > ==    e-mail:  karkola at rcs.urz.tu-dresden.de
 > ==
 > ==================================================
 > _______________________________________________
 > To control your jdom-interest membership:

More information about the jdom-interest mailing list