Re: aliasing elements

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 UTC