Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How can I compare two values?

Reply
Thread Tools

How can I compare two values?

 
 
roy_it
Guest
Posts: n/a
 
      07-04-2005
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

 
Reply With Quote
 
 
 
 
C. M. Sperberg-McQueen
Guest
Posts: n/a
 
      07-08-2005
"roy_it" <(E-Mail Removed)> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 4.14 How can I compare two dates and find the difference? PerlFAQ Server Perl Misc 0 04-04-2011 04:00 PM
FAQ 4.14 How can I compare two dates and find the difference? PerlFAQ Server Perl Misc 0 02-06-2011 11:00 AM
how can i compare two objects in Java? jenny_luarez Java 0 08-04-2009 03:05 PM
How to compare two SOAP Envelope or two Document or two XML files GenxLogic Java 3 12-06-2006 08:41 PM
can we compare two integers without using relational operators raju C Programming 49 11-07-2005 12:17 PM



Advertisments