xs:anyType

Discussion in 'XML' started by Igor Akkerman, Jul 31, 2003.

  1. Hi,

    why does

    <xs:element name="any" type="xs:anyType" />

    not validate

    <any><foo><bar>blah</bar></foo></any> ?

    Isn't xs:anyType meant to accept any well-formed xml-tree?

    Igor
     
    Igor Akkerman, Jul 31, 2003
    #1
    1. Advertising

  2. > why does
    > <xs:element name="any" type="xs:anyType" />
    > not validate
    > <any><foo><bar>blah</bar></foo></any> ?
    >
    > Isn't xs:anyType meant to accept any well-formed xml-tree?
    >

    No, "xs:anyType" is the root *type* of W3C's type definitions (like
    java.lang.Object).
    What you are looking for is the <xs:any/> element.
    http://www.w3.org/TR/xmlschema-1/#element-any

    Jesper

    --
    Jesper Zedlitz eMail :
    Homepage : http://www.zedlitz.de
    ICQ# : 23890711
    PGP-Key : http://zedlitz.de/pub_key.asc
     
    Jesper Zedlitz, Jul 31, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jamest

    jaxb use of AnyType

    jamest, Jul 26, 2005, in forum: Java
    Replies:
    0
    Views:
    2,642
    jamest
    Jul 26, 2005
  2. Replies:
    0
    Views:
    3,469
  3. Razvan
    Replies:
    3
    Views:
    568
    Peter Flynn
    Mar 2, 2005
  4. Sonna Nach
    Replies:
    0
    Views:
    822
    Sonna Nach
    Mar 8, 2005
  5. Brett Gerhardi

    XSD Restricting Anytype behaviour

    Brett Gerhardi, May 19, 2005, in forum: XML
    Replies:
    1
    Views:
    537
    Brett Gerhardi
    May 19, 2005
Loading...

Share This Page