473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

XSD attribute exclusion expression

Hi to all;

I have a very basic question: is is possible in XML Schema to express
that two attributes on an XML element are exclusive, and if yes, what
is the most appropriate idiomatic syntax for that ?

I am grateful for your help. Regards,

Edouard
Jul 20 '05 #1
4 3728
If you mean, can an XML Schema allow one attribute or the other but not
both, the answer is no. There is no way to specify a choice of attributes.

RELAX NG can do this, or a Schematron augmentation of an XML Schema.

Bob Foster
http://www.xmlbuddy.com/

"Edouard Mercier" <ed*************@noos.fr> wrote in message
news:25**************************@posting.google.c om...
Hi to all;

I have a very basic question: is is possible in XML Schema to express
that two attributes on an XML element are exclusive, and if yes, what
is the most appropriate idiomatic syntax for that ?

I am grateful for your help. Regards,

Edouard

Jul 20 '05 #2
That's actually what I meant and thank you for the answer: "there is
no way to specify a choice of attributes".

Could you please provide a good URL concerning the main differences
between XSD and Relax NG ?

Regards,

Edouard

"Bob Foster" <bo********@comcast.net> wrote in message news:<t8O4b.327585$uu5.67151@sccrnsc04>...
If you mean, can an XML Schema allow one attribute or the other but not
both, the answer is no. There is no way to specify a choice of attributes.

RELAX NG can do this, or a Schematron augmentation of an XML Schema.

Bob Foster
http://www.xmlbuddy.com/

Jul 20 '05 #3
"Edouard Mercier" <th*****************@free.fr> wrote in message
news:ab**************************@posting.google.c om...
Could you please provide a good URL concerning the main differences
between XSD and Relax NG ?


I can't think of one off the top of my head. The main positive differences
are:

RELAX NG:

Ambiguous content models allowed
Choices may depend on attributes and values, not just elements
General "define" mechanism
Datatype libraries (no special "blessed" types)
(XSD simple types supported by library)
Formal definition
Very easy to learn
Conformant implementations (Jing and MSV)
Both XML and compact syntax
Oasis/ISO draft standard
"The fastest way to write an XSD schema is to write a RELAX NG compact
syntax schema and use Trang to convert it to XSD."

XSD:

unique, key, keyref
Substitution groups
Named type derivation
W3 recommendation
Used in XQuery/XSLT 2.0/XPath 2.0
Used in WSDL

If a plus appears in one list, it is a minus in the other. Both have a
number of free tools available. Trang is an especially interesting tool, as
it converts between various schema formats with good fidelity.

Bob Foster
http://www.xmlbuddy.com/
Jul 20 '05 #4
Thank you very much, Bob, for your additional information: I think
that I should take a throrough look at Relax NG !

Regards,

Edouard
I can't think of one off the top of my head. The main positive differences
are:

RELAX NG:

Ambiguous content models allowed
Choices may depend on attributes and values, not just elements
General "define" mechanism
Datatype libraries (no special "blessed" types)
(XSD simple types supported by library)
Formal definition
Very easy to learn
Conformant implementations (Jing and MSV)
Both XML and compact syntax
Oasis/ISO draft standard
"The fastest way to write an XSD schema is to write a RELAX NG compact
syntax schema and use Trang to convert it to XSD."

XSD:

unique, key, keyref
Substitution groups
Named type derivation
W3 recommendation
Used in XQuery/XSLT 2.0/XPath 2.0
Used in WSDL

If a plus appears in one list, it is a minus in the other. Both have a
number of free tools available. Trang is an especially interesting tool, as
it converts between various schema formats with good fidelity.

Bob Foster
http://www.xmlbuddy.com/

Jul 20 '05 #5

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

Similar topics

2
by: GIMME | last post by:
For starters .... If : //input is the xpath syntax to see if an element with an attribute named start_date exists ... Then what is the xpath syntax to return elements having
4
by: Jamie Jackson | last post by:
I know that it's possible to return false in an onClick to disable a link. Is there a way to do this within the HREF attribute? Something like: <a href="javascript: return false;"> ? Thanks,...
0
by: Jeff User | last post by:
Here is what I have and what I would like to do: I am building a web client application. I add a web reference to some web service server to my project so that now I can call the web service. A...
2
by: Jeff User | last post by:
Here is what I have and what I would like to do: I am building a web client application. I add a web reference to some web service server to my project so that now I can call the web service. A...
78
by: wkehowski | last post by:
The python code below generates a cartesian product subject to any logical combination of wildcard exclusions. For example, suppose I want to generate a cartesian product S^n, n>=3, of that...
8
by: Philip Ronan | last post by:
Hi, I recently discovered that Google's mobile search robot doesn't understand the "robots" Meta tag. Here's an example: ...
4
by: Hemal Pandya | last post by:
Hello, I am hoping this is a simple question with a straightforward solution. I do not understand xsl much, so I apologize in advance if I am asking a stupid question. Is it possible to write...
1
by: illegal.prime | last post by:
So I have a container of objects that I don't want to iterate across when I'm modifying it. I.E. I lock on adds and deletes to the container - so that my traversals of it don't result in...
5
by: Patrick A | last post by:
All, I'm dealing with a 3rd party application that can't interpret the Access function FormatCurrency. When it encounters my query with "Exclu: FormatCurrency(, 0)", it arfs. The vendor says...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.