Tim, 

 

A good start would be the following documentation page: 
http://xmlbeans.apache.org/docs/2.0.0/guide/conIntroToTheSchemaTypeSystem.html

You should check the SchemaType interface and using getContentModel() method to 
check for the required particles.

 

Cezar

 

________________________________

From: Tim Dilks [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 03, 2008 10:08 AM
To: [email protected]
Subject: Xml Element Insertion - Updating Dom Tree

 

I am developing an application (a bit like XmlSpy) which allows users to load 
an xml file (with an 'scomp'ed schema), and will allow insertions and data 
entry.

 

I have a JtreeTable which I am populating using the 

 

                  doc = xxxxDocument.Factory.parse(tempFile);

                  return (Document) doc.getDomNode();

 

When the user clicks on a node in the Jtree, a window is updated to show the 
valid elements available for insert.  I have this part all working nicely.

 

The functionality I am working on implementing now is: the user clicks an 'add' 
button next to a listed element, and that element should be inserted into the 
tree (and of course the underlying xml).  It would be good to have all 
mandatory elements created for that inserted node as well.

 

Any high level pointers about how best to proceed here would be much 
appreciated.

 

Thanks.

 

Reply via email to