One possible raw approach is using the
org.apache.xerces.parsers.XMLGrammarPreparser for parsing the schema.
You can will get a XSGrammar. Then use the toXSModel() to get a XSmodel.
Now find the possible root elements from the global element
declarations:
XSNamedMap elementDeclarations = xsModel
.getComponents(XSConstants.ELEMENT_DECLARATION);
Then recursively visit the XSModel to get all elements and attributes.
But to do this well it is al lot of work !!
Regards
Dick Deneer
Op 18-nov-2008, om 9:56 heeft chodnik het volgende geschreven:
Hi everyone
I want to make an application for creating xml document. The
document must
match a schema. When I create new DOM document I want to now what
element
(or elements) can be the root node. Then I should create and add
this node
and query what attributes are acceptable for this element and what
children
it can have. When there is an ambiguity the application should ask
me what
to choose. Have jou any ideas to do it? I've been searching for this
solution since two weeks and there is no that is sufficient for me.
--
View this message in context: http://www.nabble.com/Create-a-new-
xml-document-based-on-a-schema-tp20555635p20555635.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]