W3C home > Mailing lists > Public > public-schemata-users@w3.org > August 2006

Re: aliasing elements

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Wed, 16 Aug 2006 16:25:40 -0400
To: public-schemata-users@w3.org
Message-id: <7.0.1.0.2.20060816161158.02ae9538@CraneSoftwrights.com>

At 2006-08-16 14:38 -0400, Jim Jewett wrote:
>Is there any way to alias an element or attribute from another namespace?

Processing applications can implement an 
"aliasing" concept, but there is no such concept in markup definition.

>This immediate spur of this question is that the XHTML 2.0 draft is
>struggling with xml:id
>
>http://www.w3.org/TR/xhtml2/mod-core.html#col_Core
>
>At the moment, it defines both id and xml:id, but says not to use them
>on the same element.  I believe what they really want is to say is
>closer to:
>
>xml:id is a core attribute.  id is just an alias for xml:id.  It is
>not merely similar, or a second copy; it is the same attribute, so
>only one of the two names can be used on any given element.

But all they can say in document constraints is 
the last sentence: "only one of the two names can 
be used on a given element".  It would be up to 
the user agent to interpret the specification of 
one to be the alias of the other.

This document constraint is a co-occurrence 
constraint.  Not many validation languages 
support co-occurrence constraints, only RELAX-NG and Schematron.

In RELAX-NG compact syntax I can say:

id-attrs = ( attribute id { xsd:ID } | attribute xml:id { xsd:ID } )

and then on each element "X" say:

element X = id-attrs?, ....

I see from Annex B of your document that RELAX-NG 
is being used, so you should be okay.

>I believe that xml:lang and xml:base are similar,

I don't see how.

>and there is a chance that aliasing could help 
>resolve some of the problems with xlink.

If so, then it would probably, again, be a 
co-occurrence constraint of expressing the 
mutual-exclusiveness of multiple attributes.

I hope this helps.

. . . . . . . . . . . Ken

--
UBL/XML/XSLT/XSL-FO training:         Vårø, Denmark 06-09-25/10-06
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/x/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
Received on Wednesday, 16 August 2006 20:26:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:16:24 GMT