As I read the docs I can understand how to access instances and how to 
build a TreeModel with getDomNode(). My problem is understanding how to build a 
TreeModel from the Schema. From the example in the Getting Started page:

purchase-order
--customer
----name
----address
--date
--lineitem
----description
----etc
--shipper
----name
----etc

    I would like to build this Tree interface based on the Schema, not from a 
document, and then be able to load into and save instances from it. Notice that 
Shipper in this example is optional for an instance document, but I want it 
always in the interface.
    If I understand correctly, your statement "The full schema is defined and 
available through the XML objects XML Beans creates" refers to the schema types 
of the XMLObjects created from an instance document. In this case, if an 
optional element is not present in an instance, it will not show as an 
XMLObject and I would be unable to get its schema type. If you really meant 
"all and every element in the schema", then I'm missing something.

    Pointers to online or printed material on this issues are welcomed also.

Cheers,

Daniel





----- Mensaje original ----
De: Eric Murphy <[EMAIL PROTECTED]>
Para: user@xmlbeans.apache.org
Enviado: martes 22 de julio de 2008, 0:22:38
Asunto: RE: Advice about tools

 
Daniel –
 
An XML document is a tree model for data. Look
at XML Beans XmlCursor documentation:
 
http://xmlbeans.apache.org/docs/2.2.0/reference/index.html
 
You have full access to the nodes of the
tree through XmlCursor.getDomNode. This allows you to find all the children as
well as parents of a node. In addition you can use xPath to query your document
to aid in navigation and updating of elements. There are other ways to navigate
the document as well (XmlCursor is very useful). The full schema is defined and
available through the XML objects XML Beans creates. You can make your tool
entirely generic (able to handle any XML document).
 
Eric
 
 
 

________________________________
 
From:Daniel Toffetti [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 21, 2008 7:45
PM
To: user@xmlbeans.apache.org
Subject: Advice about tools
 
Hi !

    I would like to know if it's possible to do what I'm trying
to do, and what would be the best tools to do that.
    Here is it: I want to load an XML Schema Definition into a
TreeModel to display it in a user interface. The user should be able to
interact with that interface to add and edit data, and then save the edited
data as an XML Instance document.
    In other words, I want the user to be presented with the
full Schema in the form of a tree template, where he can add data as needed and
save instances.
    I will have to use some knowledge of the specific Schemas,
for example for adding localized labels or some custom item editing features,
but other than that, I want this to be as automatic as possible, I mean, if
possible, I don't want to build the TreeModel by hand using knowledge of the
specific XSD.

    Is this possible using available standards / libraries ??

Cheers,

Daniel
 

________________________________
 

¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en
Claro
http://ar.mobile.yahoo.com/onesearch


      
____________________________________________________________________________________
¡Buscá desde tu celular!

Yahoo! oneSEARCH ahora está en Claro

http://ar.mobile.yahoo.com/onesearch

Reply via email to