Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [xsd-dev] XML instance


The XSD model would definitely be very helpful for implementing this type
of thing.  I would imagine that you would want to start with the set of
global elements as the possible roots, and then to look at each element's
type to determine if it is a complex type with complex content (and hence
allows child elements).   For each such element with complex content, you
would want to recursively visit the elements in the complex content.  For
completeness, you might/probably need to take substitution groups into
account, i.e., XSDElementDeclaration.getSubstitutionGroup(), since this
represent and implicit choice in the content model. The use of xsi:type can
also allow for content that isn't "expected", but I'm not sure how this
should be taken into account.  Note that this type of tree walk may well be
recursive and non-terminating, i.e., the deepest possible XML may be
infinitely deep...

BTW, issues like this are better discussed on the newsgroup so that a
broader audience is likely to help with answers and so that more folks will
benefit from the answers:


Ed Merks/Toronto/IBM@IBMCA
mailto: merks@xxxxxxxxxx
905-413-3265  (t/l 969)

                      Galeteanu"               To:       <xsd-dev@xxxxxxxxxxx>                                                                      
                      <mgaleteanu@freeb        cc:                                                                                                  
            >              Subject:  RE: [xsd-dev] XML instance                                                                 
                      Sent by:                                                                                                                      
                      06/26/2003 12:43                                                                                                              
                      Please respond to                                                                                                             

I'm trying to implement an algorithm that will find the root of the deepest
possible xml tree instance based on a specific schema. Basically, I'm
trying to generate an instace that will contain all the possible
elements/attributes allowed for the schema...any ideas on how to achieve

-----Original Message-----
From: Ed Merks [mailto:merks@xxxxxxxxxx]
Sent: Wednesday, June 25, 2003 8:25 AM
To: xsd-dev@xxxxxxxxxxx
Cc: xsd-dev@xxxxxxxxxxx; xsd-dev-admin@xxxxxxxxxxx
Subject: Re: [xsd-dev] XML instance


We haven't implemented instance generation as part of the XSD code base,
but it could certainly be implemented using the XSD model.  But you
probably want something that works out of the box.  I tried looking at
alphaworks, but I didn't see anything obvious there:

I'm not sure where else you could search...

I've blind copied someone who may have a better answer.

Ed Merks/Toronto/IBM@IBMCA
mailto: merks@xxxxxxxxxx
905-413-3265  (t/l 969)


                      Galeteanu"               To:

                      <mgaleteanu@freeb        cc:

            >              Subject:  [xsd-dev] XML

                      Sent by:



                      06/24/2003 10:33


                      Please respond to


Is there a way to get an XML Instance from a schema using the XSD Plugin?

Mihnea Galeteanu

Software developer co-op, Research and Development

FreeBalance Inc.

T (613) 236-5150 ext.375

F (613) 236-8405


This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure, or distribution is prohibited. If you are not the intended
recipient(s) please contact the sender by reply email and destroy all
copies of the original message and any attachments.

xsd-dev mailing list
xsd-dev mailing list

Back to the top