Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Redefining an enumerated attribute type

Reply
Thread Tools

Redefining an enumerated attribute type

 
 
Nick Bassiliades
Guest
Posts: n/a
 
      12-09-2005
Hi everybody,

I would like to ask a very specific question about how I can re-define
an enumerated attribute type.
Specifically, I have two XML Schema files.

In file A I have the following attribute group declaration:

*********** file A ******************
<xs:attributeGroup name="kind.attrib">
<xs:attribute name="kind" use="optional" default="fo">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="fo"/>
<xs:enumeration value="lp"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
*************************************

I file B I want to re-define this attribute in order to include
more constants as possible values for the @kind attribute.
The following produces an error, because the new definition
is not a restriction of the definition found in file A:

***************** file B *********************
<xs:redefine schemaLocation="...file A">
<xs:attributeGroup name="kind.attrib">
<xs:attribute name="kind" use="required" default="dr">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="fo"/>
<xs:enumeration value="lp"/>
<xs:enumeration value="sr"/>
<xs:enumeration value="dr"/>
<xs:enumeration value="df"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
....
*************************************


Notice, that I cannot just change the definition in file A because I
simply do not own it.
How could this be done? How could I extend in a redefinition and not
restrict it?

I have also tried with union but I get the same message (union is an
extension, not a restriction).

Thank you in advance,

Nick Bassiliades
 
Reply With Quote
 
 
 
 
Henry S. Thompson
Guest
Posts: n/a
 
      12-12-2005
Nick Bassiliades writes:


> I file B I want to re-define this attribute in order to include
> more constants as possible values for [an enumeration].


> Notice, that I cannot just change the definition in file A because I
> simply do not own it.
> How could this be done? How could I extend in a redefinition and not
> restrict it?


The short answer is 'no'.

The slightly longer answer is that there are good ways to design an
extendable enumeration type, but that requires a change to the
original definition, which you say you can't do.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: http://www.velocityreviews.com/forums/(E-Mail Removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
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
How to step through an enumerated type? Andrew FPGA VHDL 1 06-26-2006 02:33 AM
define attribute as NOT a member of enumerated type davidmcb@pacbell.net XML 1 03-06-2006 05:16 AM
define attribute as NOT a member of enumerated type David XML 0 03-01-2006 01:11 PM
Enumerated Type in assertion ? Marek Ponca VHDL 2 01-10-2005 10:32 AM
How to obtain enumerated attribute declarations from a DTD using MSXML & VB? Alastair Cameron XML 1 07-04-2003 03:03 PM



Advertisments