[jdom-interest] DTD parsing/validation question

Kenworthy, Edward edward.kenworthy at exchange.co.uk
Mon May 21 23:08:43 PDT 2001


Hi Frank

I've done exactly that but using an XML schema. I wrote the code myself -
it's quite straightforward. In essence my Document contains both the actual
XML document AND another instance of the JDom Document which is the
document's schema.

My Document then provides methods to:

1) check if one element can be a child of another
2) return a list of all possible children of the given element.

Note in each case I check based on the element (not element type) so that I
can take into account restrictions on multiplicity.

Hope this points you in the right direction.

Edward


-----Original Message-----
From: Frank Sauer [mailto:Frank.Sauer at trcinc.com]
Sent: 21 May 2001 20:58
To: jdom-interest at jdom.org
Subject: [jdom-interest] DTD parsing/validation question


Has anybody written code based on JDOM and the DTD parser
from Mark Wutka to determine what are :

1) valid predecessors of a given JDOM node (to insert before the given node)
2) valid successors of a given JDOM node (to insert after the given node)
3) valid children of a given JDOM node (to add as a child to the given node)

The idea is to populate a popupmenu on a tree node with
only those tags that are valid given the DTD and the current
state of the document.

Any ideas or better yet, code, would be very much appreciated.

Thanks,

Frank Sauer
The Technical Resource Connection
Tampa, FL
http://www.trcinc.com
Visit us at JavaOne booth 1211
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list