XMLSchema syntax problem

Discussion in 'XML' started by AL, Nov 7, 2005.

  1. AL

    AL Guest

    Hi all,

    I have an XML document like this:
    <root>
    <node>A</node>
    <node>B</node>
    <node>C</node>
    </root>

    it's very important validate the following xml doc:
    <root> <root>
    <node>A</node> <node>A</node>
    <node>B</node> </root>
    </root>

    and don't validate a document like this:
    <root>
    <node>B</node>
    <node>A</node>
    </root>

    I'd like to validate this document using XML Schema. Is it possible?
    Thanks!!
     
    AL, Nov 7, 2005
    #1
    1. Advertising

  2. AL wrote:
    > Hi all,
    >
    > I have an XML document like this:
    > <root>
    > <node>A</node>
    > <node>B</node>
    > <node>C</node>
    > </root>
    >
    > it's very important validate the following xml doc:
    > <root> <root>
    > <node>A</node> <node>A</node>
    > <node>B</node> </root>
    > </root>
    >
    > and don't validate a document like this:
    > <root>
    > <node>B</node>
    > <node>A</node>
    > </root>
    >
    > I'd like to validate this document using XML Schema. Is it possible?
    > Thanks!!
    >


    This is not valid using XSchema, but there
    are some other schema tecnologies,

    i think schematron could do the job for you,
    or you have to wait for the next xschema version.

    http://www.schematron.com/
     
    Tjerk Wolterink, Nov 7, 2005
    #2
    1. Advertising

  3. AL

    AL Guest

    I was afraid of it :-(
    Anyway, thanks a lot!!

    > This is not valid using XSchema, but there
    > are some other schema tecnologies,
    >
    > i think schematron could do the job for you,
    > or you have to wait for the next xschema version.
    >
    > http://www.schematron.com/
     
    AL, Nov 7, 2005
    #3
  4. Tjerk wrote:
    >
    >>This is not valid using XSchema, but there


    I meant off course:

    This is not possible with XSchema...

    But that just my intuition telling me that.
    Maybe there is some clever way you can create a schema
    for you kind of documents,

    but i dont see how
     
    Tjerk Wolterink, Nov 7, 2005
    #4
  5. "AL" <> writes:

    > Hi all,
    >
    > I have an XML document like this:
    > <root>
    > <node>A</node>
    > <node>B</node>
    > <node>C</node>
    > </root>
    >
    > it's very important validate the following xml doc:
    > <root> <root>
    > <node>A</node> <node>A</node>
    > <node>B</node> </root>
    > </root>
    >
    > and don't validate a document like this:
    > <root>
    > <node>B</node>
    > <node>A</node>
    > </root>


    I'm not sure I understand your requirement. Do you mean that that
    text content of <node> elements must appear in lexicographic order
    (sorted)?

    You certainly can't express that constraint with W3C XML Schema or
    RelaxNG. Probably can with Schematron.

    ht
    --
    Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
    Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
    Fax: (44) 131 650-4587, e-mail:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
     
    Henry S. Thompson, Nov 8, 2005
    #5
    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. sudha
    Replies:
    0
    Views:
    367
    sudha
    Jun 30, 2003
  2. Marcin Wielgus

    XMLSchema, validation

    Marcin Wielgus, Mar 16, 2006, in forum: Java
    Replies:
    0
    Views:
    674
    Marcin Wielgus
    Mar 16, 2006
  3. Robert Ludewig

    XMLSchema and XML Validation problem

    Robert Ludewig, Jun 28, 2004, in forum: XML
    Replies:
    4
    Views:
    597
    Martin Honnen
    Jun 28, 2004
  4. AL
    Replies:
    0
    Views:
    366
  5. g.fiorentini

    PROBLEM: webservice, XmlNode return value, XMLSchema and WSDL

    g.fiorentini, Sep 10, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    202
    g.fiorentini
    Sep 10, 2003
Loading...

Share This Page