xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Vasilik" <eric...@bea.com>
Subject RE: creation of new nodes
Date Wed, 14 Jul 2004 06:20:40 GMT
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).
 
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.
 
- 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
 
hi,
 
does xmlbeans have a method for creating new nodes which are valid
according to the schema? for instance, if i have a structure:
 
<foo>
            <bar/>
</foo>
 
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.
 
thanks,
 
michael

Mime
View raw message