473,670 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I compare two values?

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

Jul 20 '05 #1
1 1380
"roy_it" <ro****@katamai l.com> 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

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4484
by: Kenneth Baltrinic | last post by:
I am trying to compare values coming out of a database record with known default values. The defaults are in an array of type object (because they can be of any basic data type, I am not working with weird stuff, just strings, int, bools and DataTime values) My fields values for this record, for convenience are also in an array of objects. Now I am trying to write code like the following. private void processData (object d, object a)...
11
9707
by: Russ Green | last post by:
How does this: public TimeSpan Timeout { get { return timeout; } set { timeout = value; if(timeout < licenseTimeout) licenseTimeout = timeout; }
5
6329
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of uniqueidentifier, originally taken from objectGUID from active directory domain)
7
12883
by: Prabhudhas Peter | last post by:
I have two object instances of a same class... and i assigned values in both object instances (or the values can be taken from databse and assigned to the members of the objects)... Now i want to compare these two objects so that it will return true if both object's members have the same value... it is good if u can give me a single function or simple code snippet.. Thank U -- Peter...
0
1269
by: Nikolay Petrov | last post by:
I need to compare to byte values, but one of them may differ from the other by let's say 5%, and they still should count as same. I need a fast method, because i am going to compare a set of about 1 000 000 with other set of 1 000 000 bytes. This should go in below 1 sec. Can't figure the algorithm What I try to achive is to compare two bitmaps, which may have some of theit pixles in different RGB values. I need to check if those...
10
1228
by: Y2K | last post by:
Any suggestions to compare two values, and if either value changes, then both values now become the changed values. Right now I'm doing it with a textbox and onchange event, but would like to get rid of the textbox and use internal variables. TIA
3
9254
by: mcolson | last post by:
I am trying to compare the last two values in the same column of a table. First of all, I have a column titled Row_Index that uses an index which starts at 1 and increments by 1. What I am trying to do is compare the values in the column 'Shift_Date' for the maximum value of Row_Index and the (maximum value - 1) of Row_Index. I've been trying to declare two strings, setting each string equal to one of my values, and then comparing the...
3
2891
by: =?Utf-8?B?UmljY2FyZG8=?= | last post by:
What is the best method to compare 2 array to knw if each element is equal? Now, i have to compare the datarow.itemarray of 2 datarows wich is equals in structure. I tried to write this routine: (OPTION STRICT MUST BE ON!!) Private Function ISArrayEquals(ByVal A As Array, ByVal B As Array) As Boolean For index As Integer = 0 To A.Length - 1 If A.GetValue(index) <B.GetValue(index) Then '<----Here is the error! Return False End If
26
7131
by: neha_chhatre | last post by:
can anybody tell me how to compare two float values say for example t and check are two variables declared float how to compare t and check please help me as soon as possible
5
2477
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I have a Container that is an an Array List of Class Each ArrayList element can be the class or a another ArrayList of Class So there the ArrayList could look like Element 1 - Class Element 2 - Class Element 1 - ArrayList Of Class Element 1 - Class
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8592
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5684
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2800
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2042
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.