Try this link on the Wiki ... http://wiki.apache.org/xmlbeans/XmlBeansTutorial/MixedContent
I know your not doing mixed content but it does show how to add the element etc. Don -----Original Message----- From: P. Michael Hutchins [mailto:[EMAIL PROTECTED] Sent: 16 May 2005 17:56 To: [email protected] Subject: RE: Sequence of <any>, Writing Could someone please post some example code that shows how to actually do this (your "But using the lower interfaces XmlCursor or DOM, elements and attributes can be added, removed or modified, in the right place.") To get off the ground, suppose I have an XmlObject, A, that I want to ... in effect, .add() ... to another XmlObject, B. Looking through the available methods - for both XmlObject and XmlCursor - I didn't find anything at all promising.. ..and trying to punt down to Node, I couldn't figure out how to get from the world of xmlBeans to the world of DOM. (or vice versa) How do people live w/o an ability to do this stuff? How is it that it doesn't come up so often that there's already info on your site on how to deal w/ it? (We were presented w/ a schema that calls for this; we can't change it.) (additionally: Is using <all> always/often a bad / suboptimal idea?) Thanks, -- M. At 05:36 PM 5/12/2005, you wrote: > From the XmlObject and generated interfaces level there isn't a straight >forward way to alter the elements in the any buckets, there is just read >access through selectElements/selectAttributes. >But using the lower interfaces XmlCursor or DOM, elements and attributes >can be added, removed or modified, in the right place. > >For your example all the child elements are in the 'any' bucket, but for >more complex content models partial validation might be needed to find >the right place. > >Cezar > > > -----Original Message----- > > From: P. Michael Hutchins [mailto:[EMAIL PROTECTED] > > Sent: Thursday, May 12, 2005 2:42 PM > > To: [email protected] > > Subject: Sequence of <any>, Writing > > > > (no allegation of lack of stupidity herein ;-) > > > > When one specifies in a schema a sequence of element, xmlbeans makes >the > > expected .add...() method.. > > (at least if the min- & max- -Occurs is specified) > > > > ..but for a sequence of <any>, there's no such method available. > > > > > > Searching your site, I found some mumbling stating realization that > > xmlbeans doesn't ... what? support? ... <any> (, etc.). > > (which original statement, I did not find) > > > > I wasn't able to find anything on [sequence of <any>], so I ask: > > > > What's the best way to create a(n XML instance document containing a) > > sequence of <any> elements? > > (given that one is using the classes that scomp produced from the XSD) > > > > eg: > > > > for an XSD containing: > > > > <xs:complexType name="foo"> > > <xs:sequence minOccurs="1" maxOccurs="232"> > > <xs:any processContents="lax" minOccurs="0" >maxOccurs="unbounded"/> > > </xs:sequence> > > <xs:attribute name="priority" type="xs:string" > > use="optional"> </xs:attribute> > > </xs:complexType> > > > > , once one has a foo object in his hand, how's best to ~.add()~ >whatever > > ... elements(?) ... one has? > > (suppose I have more than one such thingy I want to put in where the > > xs:any is) > > > > > > Thanks, > > > > -- M. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

