|
Hi, sorry but I found your solution a little too long for the little
thing I had to do. And for me, I knew exactly where the text had to go.
So i changed my xsd to the following and then got a
get/setStringValue()) method !! here is the xsd : <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="testCase"> <xs:complexType> <xs:sequence> <xs:element name="test" type="testType" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="active" type="xs:boolean" use="required" /> </xs:complexType> </xs:element> <xs:complexType name="testType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="command" type="xs:string" use="required" /> <xs:attribute name="target" type="xs:string" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:schema> Yana Kadiyska wrote: Hi, there is no method generated for adding text as in the general case, it is somewhat unclear where the user wants the text (i.e. if the content is a sequence of elements, for example, the user could want the text between any two of the elements). In order to put the text where you want it, you need to use the cursor api. You can also consult file \xmlbeans\trunk\test\src\scomp\contentType\complex\detailed\MixedContent Test.java for a very simple example (assuming you've checked out the source or look at the online Subversion browser version)Hope this helps. Yana -----Original Message----- From: Ducloux Victor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 16, 2005 2:10 AM To: [email protected] Subject: complexType & mixed=true Hi, everybody, I'm totally new to xmlbeans and to this mailing list. I'm very happy of xmlbeans and provides me a gain of lots of time.. Whatever, I've got a small problem. I ve got an xml schema and one of the types is a complexType with the attribute mixed=true. I've generated the xmltypes into a jar, and now I would like to use them to add attributes to my element, of course, but also text (that's why I've put mixed=true) BUT, I can't find & don't know which method to use to add text into an element... here is my schema : <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="testCase"> <xs:complexType> <xs:sequence> <xs:element name="test" type="testType" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> </xs:complexType> </xs:element> <xs:complexType name="testType" mixed="true"> <xs:attribute name="command" type="xs:string" use="required" /> <xs:attribute name="target" type="xs:string" use="required" /> </xs:complexType> </xs:schema> I just want to add som text into the element "test" which uses the complexType "testType" ! I've got all the methods get/setCommand & get/setTarget but none I've found to add text! Anyone knows how ? thanks in advance , Victor --------------------------------------------------------------------- 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] --
|
- complexType & mixed=true Ducloux Victor
- RE: complexType & mixed=true Yana Kadiyska
- Re: complexType & mixed=true Ducloux Victor
- Re: complexType & mixed=true Ducloux Victor

