xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Lancaster <m.lancas...@ph.unimelb.edu.au>
Subject RE: creation of new nodes
Date Thu, 15 Jul 2004 00:30:42 GMT
fair enough... i solved the problem by just creating a vanilla document and
starting from there..


*       I do believe that there was a sample generator which would construct
instances from various schema types.  It did not 

*       handle all the cases, but dealt fairly well with simple ones.


do you know where this sample is? i searched the web but couldn't find it...


thanks heaps,




ps great product...




From: Eric Vasilik [mailto:ericvas@bea.com] 
Sent: Wednesday, 14 July 2004 4:21 PM
To: xmlbeans-user@xml.apache.org
Subject: RE: creation of new nodes


XmlBeans does not do this.  All documents, elements and attributes are
constructed at the request of the user.  If one were to consider the
automatic creation of content in order to create a valid document, one would
not stop at simply creating a child element.  Consider a schema which
requires a thousand bar's under foo.  Would you want all 1000 to be created?
What if the schema required 1000-2000 bars?  Does one split the difference
and create 1500?  What about the values that the bars must have to be valid?
Creating an instance for a given schema is ambiguous and difficult.  (Also
consider regular expressions -- constructing strings which are valid with
respect to them can be nasty).



- Eric


-----Original Message-----
From: Michael Lancaster [mailto:M.Lancaster@philology.com.au] 
Sent: Tuesday, July 13, 2004 6:09 PM
To: xmlbeans-user@xml.apache.org
Subject: creation of new nodes




does xmlbeans have a method for creating new nodes which are valid according
to the schema? for instance, if i have a structure:






where <bar> is a mandatory child-element of <foo>, is there a way that
xmlbeans will automatically create <bar> when i create <foo>? otherwise this
has to be done manually in order to create a valid document, which seems to
defeat some of the purpose of the separation of code and data structure.


any help would be greatly appreciated.





View raw message