You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Stefan Lischke <s....@zertificon.com> on 2008/03/10 12:10:29 UTC

(maybe ot) allow text or xs:any

Hi,

It may be OT, but maybe you can help me, i need an xsd expression to
allow text-content or any other node like

<node>text</node>

or

<node><anynode/></node>

when using xs:any i cannot put in simple text there

any idea?

thanx in advance

Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: (maybe ot) allow text or xs:any

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
Are you sure you are not running off of a stale version of your Schema
(maybe one where you don't have the minOccurs="0")? Or that you don't
have multiple definitions for "CAdata"?

The way you posted this example, validation is passing for me.

Radu

On Tue, 2008-03-11 at 11:02 -0700, Stefan Lischke wrote:
> Thanx John,
> 
> that helped a little bit, but there is still an error, i have the
> following XSD-snippet:
> 
> <xs:element name="CAdata" minOccurs="0" maxOccurs="1" >
>          <xs:complexType mixed="true">
>               <xs:sequence>
>                    <xs:any namespace="##any" processContents="lax"
> minOccurs="0" maxOccurs="unbounded"/>
>               </xs:sequence>
>               <xs:attribute name="CAname" type="xs:string"
> use="required"/>
>          </xs:complexType>
> </xs:element>
> 
> and the xml
> 
> 
> <XXX>
>   ........
>   <CAdata CAname="foo">bar</CAdata>
> </XXX>'
> 
> 
> And i got the error:
> 
> error: cvc-complex-type.2.4d: Expected element(s) in element
> CAdata@http://www......
> 
> 
> Psoroulas John wrote:
> > Stefan,
> >
> > you can use a "mixed" content type. In the definition of your
> element in
> > XSD, declare the attribute "mixed" as "true".
> >
> > Regards,
> >
> > John
> >
> >
> >
> > On Mon, March 10, 2008 13:10, Stefan Lischke wrote:
> >  
> >> Hi,
> >>
> >>
> >> It may be OT, but maybe you can help me, i need an xsd expression
> to
> >> allow text-content or any other node like
> >>
> >> <node>text</node>
> >>
> >>
> >> or
> >>
> >> <node><anynode/></node>
> >>
> >>
> >> when using xs:any i cannot put in simple text there
> >>
> >> any idea?
> >>
> >> thanx in advance
> >>
> >> Stefan
> >>    
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: (maybe ot) allow text or xs:any

Posted by Stefan Lischke <s....@zertificon.com>.
Thanx John,

that helped a little bit, but there is still an error, i have the
following XSD-snippet:

<xs:element name="CAdata" minOccurs="0" maxOccurs="1" >
         <xs:complexType mixed="true">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
              <xs:attribute name="CAname" type="xs:string" use="required"/>
         </xs:complexType>
</xs:element>

and the xml


<XXX>
  ........
  <CAdata CAname="foo">bar</CAdata>
</XXX>'


And i got the error:

error: cvc-complex-type.2.4d: Expected element(s) in element
CAdata@http://www......


Psoroulas John wrote:
> Stefan,
>
> you can use a "mixed" content type. In the definition of your element in
> XSD, declare the attribute "mixed" as "true".
>
> Regards,
>
> John
>
>
>
> On Mon, March 10, 2008 13:10, Stefan Lischke wrote:
>   
>> Hi,
>>
>>
>> It may be OT, but maybe you can help me, i need an xsd expression to
>> allow text-content or any other node like
>>
>> <node>text</node>
>>
>>
>> or
>>
>> <node><anynode/></node>
>>
>>
>> when using xs:any i cannot put in simple text there
>>
>> any idea?
>>
>> thanx in advance
>>
>> Stefan
>>     



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: (maybe ot) allow text or xs:any

Posted by Psoroulas John <ps...@telecom.ntua.gr>.
Stefan,

you can use a "mixed" content type. In the definition of your element in
XSD, declare the attribute "mixed" as "true".

Regards,

John



On Mon, March 10, 2008 13:10, Stefan Lischke wrote:
> Hi,
>
>
> It may be OT, but maybe you can help me, i need an xsd expression to
> allow text-content or any other node like
>
> <node>text</node>
>
>
> or
>
> <node><anynode/></node>
>
>
> when using xs:any i cannot put in simple text there
>
> any idea?
>
> thanx in advance
>
> Stefan
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org