Hi Muruga,
Sorry for the late reply.
As I mentioned before, the DOMUtil.java [1] class provides methods to
traverse a DOM or DOM like structure in memory to build a SchemaGrammar.
The parsing of an XML Schema document and its traversal is done in
XSDHandler [2].
You need to find a way to pass the exsiting DOM tree to the XSDTraverser
and make sure that DOMUtil.java is not missing any traversal methods. The
method that is traversing/building the schema in XSDHandler is located in
line 333:
public SchemaGrammar parseSchema(XMLInputSource is, XSDDescription
desc,
Hashtable locationPairs
This method also is called from XMLSchemaLoader [3] class - that provides a
public API for loading schemas. I am not sure yet if this is the right
class to modify to be able to provide a DOM tree to build the schema
grammar, but you can investigate it.
Btw, the original code for loading XML Schema into a DOM tree is in Attic
dir (means that it no longer part of source code for Xerces) [4].
Currently we are loading XML Schema documents into an opti-DOM structure
[5]. You might look into this code but I don't expect you to modify it.
I hope there is enouch info to get you started.
[1]
http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xerces/util/DOMUtil.java
[2]
http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
[3]
http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
[4]
http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xerces/impl/xs/dom/Attic/
[5]
http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xerces/impl/xs/opti/
Thank you!
--
Elena Litani/ IBM Toronto
Thursday, December 18, 2003 3:52 PM
To: [EMAIL PROTECTED]
cc:
From: Muruga Chinnananchi <[EMAIL PROTECTED]>
Subject: Creating XSModel/Grammer from dom element
Hi Elena,
Thanks for the suggestion. I am willing to add this
feature to xerces..you mentioned that you could
provide more info on this. can you please send me a
note on this..so that i can get started the
implementation.
thanks,
-muruga
-------------------------------------------
Hi Muruga,
In short, there is no code in Xerces to do it.
However, Xerces2 at some point was loading schemas
into a DOM Tree (now
we
load schemas into DTM -
org.apache.xerces.impl.xs.opti)) and the
org.apache.xerces.impl.xs.traversers.XSDHandler
traversed the DOM tree
(using org.apache.xerces.util.DOMUtil) and built the
corresponding
SchemaGrammar.
While we never provided a way for a user to specify
the DOM tree that
should be traversed, given all that old code I don't
think this is too
hard.
If you are willing to help to add this functionality
to Xerces please
email
xerces-j-dev mailing list and we will give you extra
information.
Thank you,
--
Elena Litani/ IBM Toronto
Wednesday, December 03, 2003 5:20 PM
To: [EMAIL PROTECTED]
cc:
From: Muruga Chinnananchi <[EMAIL PROTECTED]>
Subject: Creating XSModel/Grammer from dom element
Hi,
I am wondering how to create SchemaGrammer directly
from an parsed <schema> dom element..I have a wsdl
which contains <schema> elements, i want to use these
<schemas> elements to create xerces XSModel.
Any help is much appreciated?
thanks
-muruga
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]