Skip to main content

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

Mihnea,

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:

   news://news.eclipse.org/eclipse.technology.xsd


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




                                                                                                                                                    
                      "Mihnea                                                                                                                       
                      Galeteanu"               To:       <xsd-dev@xxxxxxxxxxx>                                                                      
                      <mgaleteanu@freeb        cc:                                                                                                  
                      alance.com>              Subject:  RE: [xsd-dev] XML instance                                                                 
                      Sent by:                                                                                                                      
                      xsd-dev-admin@ecl                                                                                                             
                      ipse.org                                                                                                                      
                                                                                                                                                    
                                                                                                                                                    
                      06/26/2003 12:43                                                                                                              
                      PM                                                                                                                            
                      Please respond to                                                                                                             
                      xsd-dev                                                                                                                       
                                                                                                                                                    
                                                                                                                                                    



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
this?

-----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


Mihnea,

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:

   http://www.alphaworks.ibm.com/xml

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)





                      "Mihnea

                      Galeteanu"               To:
<xsd-dev@xxxxxxxxxxx>

                      <mgaleteanu@freeb        cc:

                      alance.com>              Subject:  [xsd-dev] XML
instance

                      Sent by:

                      xsd-dev-admin@ecl

                      ipse.org



                      06/24/2003 10:33

                      AM

                      Please respond to

                      xsd-dev






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


Mihnea Galeteanu


Software developer co-op, Research and Development


FreeBalance Inc.


www.FreeBalance.com


T (613) 236-5150 ext.375


F (613) 236-8405


mgaleteanu@xxxxxxxxxxxxxxx


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@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/xsd-dev
_______________________________________________
xsd-dev mailing list
xsd-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/xsd-dev





Back to the top