Holger,

Actually, I made things way more complex than was needed. 

Instead of

        <xsd:element name="anything">
                <xsd:simpleType>
                        <xsd:restriction base="xsd:string"/>
                </xsd:simpleType>
        </xsd:element>

simply use

        <xsd:element name="anything" type="xsd:string">


Sorry about the convolution in the first pass. The first pass
was based on an example that originally included an attribute
in the content model of the 'anything' element. Once I removed
the attribute I should have just restructured the definition
to the simpler form.

Keith

> -----Original Message-----
> From: Keith Jensen 
> Sent: Monday, February 12, 2001 7:46 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: anyType supported for simpleType?
> 
> 
> 
> Holger,
> 
> The description of what you are trying to do, does
> not match up the schema you defined. You said you
> problem is:
> 
> > I've got a problem to NOT constrain the content of my simple 
> > types. The
> > primer tells me that 'anyType' is the ur-type for all types.
> 
> What you attempted to do is define an element with no constraint
> on its content at all. The syntax you used
> 
> >         <xsd:element name="anything" type="xsd:anyType" /> "
> 
> will allow any combination of child elements and non-element
> content to be freely intermixed in the 'anything' element. It
> also allows any attributes to be used. Is this what you wanted?
> 
> If all you want to do is allow any non-element child data
> to be valid, then just do the following.
> 
> <xsd:element name="anything">
>       <xsd:simpleType>
>               <xsd:restriction base="xsd:string"/>
>       </xsd:simpleType>
> </xsd:element>
> 
> Since any datatype can be represented as a string and in fact
> must be represented as a string to be present in an XML document,
> the above should meet your needs.
> 
> If you really wanted to allow any mixed content (element and
> non-element) and any attributes, then what you did is what
> you need to do. By the way the schema for schemas represents
> xsd:anyType as follows:
> 
> 
>  <complexType name="anyType" mixed="true">
>   <annotation>
>    <documentation xml:lang="en">
>    Not the real urType, but as close an approximation as we can
>    get in the XML representation</documentation>
>   </annotation>
>   <sequence>
>    <any minOccurs="0" maxOccurs="unbounded"/>
>   </sequence>
>   <anyAttribute/>
>  </complexType>
> 
> You can put this definition into your schema and
> use it as the type for your element. It appears to
> work fine with Xerces-J 1.3.0. Of course it would
> be better if Xerces supported your use of xsd:anyType
> rather than forcing you to roll your own type
> definition for the ur-type.
> 
> Keith Jensen
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 12, 2001 11:27 AM
> > To: [EMAIL PROTECTED]
> > Subject: anyType supported for simpleType?
> > 
> > 
> > 
> > 
> > Hi,
> > 
> > I've got a problem to NOT constrain the content of my simple 
> > types. The
> > primer tells me that 'anyType' is the ur-type for all types.
> > 
> > "The anyType represents an abstraction called the ur-type 
> > which is the base
> > type from which all simple and complex types are derived. An 
> > anyType type
> > does not constrain its content in any way. It is possible to 
> > use anyType
> > like other types, for example:
> > 
> > 
> >         <xsd:element name="anything" type="xsd:anyType" /> "
> > 
> > But Xerxes 1.3.0 tells me the base type "anyType" is unknown. 
> > Is the base
> > type "anyType" not supported by Xerces? Specifying "anyType" 
> > for complex
> > types works fine.
> > 
> > Thanks.
> > Holger
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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]
> 
> 

Reply via email to