How can I compare two values?

Discussion in 'XML' started by roy_it, Jul 4, 2005.

  1. roy_it

    roy_it Guest

    During the validation of a xml, with my xsd file, can I compare the
    value of two attributes?

    Thank U


    Nella validazione di un xml, con un file xsd, posso confrontare i
    valori di due attributi?

    Grazie
     
    roy_it, Jul 4, 2005
    #1
    1. Advertising

  2. "roy_it" <> writes:

    > During the validation of a xml, with my xsd file, can I
    > compare the value of two attributes?


    > Nella validazione di un xml, con un file xsd, posso
    > confrontare i valori di due attributi?


    I'm not sure I understand the question.

    If you mean "Can I write a schema using XML Schema 1.0 in
    which the value of attribute x is valid if and only if it is
    less than the value of attribute y?" (or equal to, or less
    than the square of, or ...) the answer is no, unless you can
    think of some clever approach I haven't thought of.

    Such instance-based constraints, where the value (or presence
    or absence) of one attribute (or element) determines the
    limits to be imposed on some other attribute (or element), are
    not supported by XML Schema 1.0. (They are analogous to
    row-level CHECK clauses in SQL and the WG felt it was best to
    wait until there was a standard query language in which to
    express them. We could have allowed predicates using the
    definition in XPath 1.0, but we thought it would be better to
    wait for XQuery 1.0 and XPath 2.0.)

    You can impose such constraints using Schematron, I believe,
    and some such constraints can also be expressed in RelaxNG.
    There have been proposals to add them to XML Schema 1.1, or to
    define something that can be layered on top of XML Schema 1.1,
    but whether those proposals will lead anywhere remains an open
    question.

    -C. M. Sperberg-McQueen
    World Wide Web Consortium
     
    C. M. Sperberg-McQueen, Jul 8, 2005
    #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. Sukh
    Replies:
    3
    Views:
    76,639
    sloan
    Feb 6, 2006
  2. Gilbert Rebhan
    Replies:
    1
    Views:
    369
    Boudewijn Dijkstra
    Jul 18, 2005
  3. GenxLogic
    Replies:
    3
    Views:
    1,375
    andrewmcdonagh
    Dec 6, 2006
  4. www
    Replies:
    3
    Views:
    1,090
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Nov 12, 2007
  5. compare two float values

    , Feb 20, 2008, in forum: C Programming
    Replies:
    34
    Views:
    16,101
    user923005
    Feb 23, 2008
Loading...

Share This Page