XML Schema with unknown elements

Discussion in 'XML' started by hooomee@gmail.com, Jun 12, 2006.

  1. Guest

    I am trying to create a schema that has a bunch of elements that are
    well defined, but will also allow unknown elements. I would like the
    known elements to still do validation and the unknown elements to match
    a simple form: <xs:element name="*" type="xs:string />.

    Is there any way to do this sort of thing? I tried creating an element
    called <xs:element name="Details" form="unqualified"> with my known
    child elements, but the validator complains: "Details should be
    un-qualified" when i try to validate a document.
     
    , Jun 12, 2006
    #1
    1. Advertising

  2. wrote:
    > I am trying to create a schema that has a bunch of elements that are
    > well defined, but will also allow unknown elements. I would like the
    > known elements to still do validation and the unknown elements to match
    > a simple form: <xs:element name="*" type="xs:string />.
    >
    > Is there any way to do this sort of thing?


    You can and should use the xs:any element in your schema to achieve
    that, see
    <http://www.w3.org/TR/xmlschema-0/#any>
    in the XSD primer and

    <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-any>
    in the formal specification.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 13, 2006
    #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. Markus
    Replies:
    1
    Views:
    1,550
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    949
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    463
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,268
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,875
Loading...

Share This Page