W3C home > Mailing lists > Public > xml-encryption@w3.org > November 2001

Deep Extension

From: Joseph Reagle <reagle@w3.org>
Date: Wed, 28 Nov 2001 17:13:04 -0500
To: xmlschema-dev@w3.org, henry@w3.org
Cc: xenc <xml-encryption@w3.org>
Message-Id: <20011128221305.231C8B3@policy.w3.org>
How do I extend descendents of a complex type?

I have an abstract type EncryptedType which relies upon a definition of a 

  <complexType name='EncryptedType' abstract='true'>
      <element ref='xenc:CipherData'/>
      <element ... />

  <element name='CipherData' type='xenc:CipherDataType'/>
  <complexType name='CipherDataType'>
       <element name='CipherValue' type='base64Binary'/>
       <element ref='xenc:CipherReference'/>

From this abstract type, I derive two related but slightly different 

One of the derived types, EncrypteKeyType is a straightfoward extension, 
I'm adding children and attributes to the EncryptedType. *However*, the 
other type is tricky. EncryptedDataType needs nothing more complex than an 
Nonce attribute added to its CipherData. Simple requirement, but complex in 
practice I'm finding.

Can I do this sort of overload and nesting, or do I need to do something 
else, and what is recommended?

  <element name='EncryptedData' type='xenc:EncryptedDataType'/>
  <complexType name='EncryptedDataType'>
      <extension base='xenc:EncryptedType'>
          <element name='CipherData'>
                <extension base='xenc:CipherDataType'>
                  <attribute name='Nonce' type='integer' use='optional'/>

If I can't do something like this, I expect I need to make CipherDataType 
and abstract type as well, and then each derivation of EncryptedType will 
also use a derivation of CipherDataType... Does that sound right? Any 
better ideas?


Joseph Reagle Jr.                 http://www.w3.org/People/Reagle/
W3C Policy Analyst                mailto:reagle@w3.org
IETF/W3C XML-Signature Co-Chair   http://www.w3.org/Signature/
W3C XML Encryption Chair          http://www.w3.org/Encryption/2001/
Received on Wednesday, 28 November 2001 17:13:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:13:05 UTC