I've tried to do this, you don't need a schema parser and description
object, but you will have to tamper with the MSV source code a bit to get
what you want. (in this approach you'll be stuck with MSV's representation
of the schema and will have to look at the source code to get what you
want).

1. You'll have to add a method to get the top level schema element inside
the com.sun.msv.verifier.jarv.SchemaImpl class.

2. Once you get this element, there is a visit() call that you can make on
all such Schema Elements, with your own custom visitor. You can use the
visitor to traverse the schema and create your own datastructure binding
together all the schema descriptions MSV parsed for you. (I used a
hashtable with every Object mapping to a list of subtag-describing objects
and a list of attribute-describing objects : this is in the context of
Xml Schema, something similar should be possible in the context of DTD's 
etc : I dunno)

 - Vivek


 On Fri, 26 Apr 2002, Christopher M. Golden wrote:

> I'm trying to find a way to get an object that describes what is allowed
> by a schema.� I've been using MSV for all of my validation, but finding a
> description of how to get the information contained in a schema through
> it has been driving me nuts for a week!� I really don't want to have to
> write my own schema parser and description object, does anyone know how
> to do this?� I want to be able to determine: what elements and attributes
> are valid under the given schema, how many of each element can their be
> under a given element, what type each element and attribute is, etc.� I
> KNOW that all of this information is available through MSV, but I have
> yet to find a decent way to get to it.� Anyone have some suggestions?
> �
> �
> Chris Golden
> _______________________________________________ dom4j-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dom4j-user
> 


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to