jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xenc-schema.rng
changeset 24633 342927a97039
parent 24620 b94e447ecd9b
parent 24632 bb22b643c35c
child 24634 68a979478ffb
equal deleted inserted replaced
24620:b94e447ecd9b 24633:342927a97039
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- http://www.xml.com/lpt/a/2002/01/23/relaxng.html -->
       
     3 <!-- http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html -->
       
     4 <!-- http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_wildcards_st8.html -->
       
     5 <!-- http://lists.oasis-open.org/archives/relax-ng-comment/200206/maillist.html -->
       
     6 
       
     7 <grammar xmlns='http://relaxng.org/ns/structure/1.0'
       
     8         xmlns:ds='http://www.w3.org/2000/09/xmldsig#'
       
     9         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
    10         ns="http://www.w3.org/2001/04/xmlenc#"
       
    11         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
       
    12 
       
    13     <include href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-schema.rng">
       
    14     <!-- Used for DigestMethod, KeyInfoType and anyThing -->
       
    15     <!-- Since xmldsig-core also has a start, I have to include it
       
    16         in the include for redefinition. -->
       
    17         <start>
       
    18             <choice>
       
    19                 <!-- We get to define the permissible root elements! -->
       
    20                 <element name="EncryptedData"><ref name="EncryptedDataType"/></element>
       
    21                 <element name="EncryptedKey"><ref name="EncryptedKeyType"/></element>
       
    22             </choice>
       
    23         </start>   
       
    24         
       
    25         <define name='anyThing'>
       
    26             <zeroOrMore>
       
    27                 <choice>
       
    28                     <text/>
       
    29                     <element>
       
    30                         <anyName>
       
    31                             <except>
       
    32                                 <nsName/>
       
    33                                 <nsName ns='http://www.w3.org/2000/09/xmldsig#'/>
       
    34                             </except>
       
    35                         </anyName>
       
    36                         <ref name='anyThing'/>
       
    37                         <zeroOrMore>
       
    38                             <attribute>
       
    39                               <anyName/>
       
    40                             </attribute>
       
    41                         </zeroOrMore>
       
    42                     </element>
       
    43                 </choice>
       
    44             </zeroOrMore>
       
    45             </define>
       
    46         
       
    47         
       
    48     </include>
       
    49     
       
    50         <!-- Import definitions from the xmldsig rng -->
       
    51 
       
    52         <define name="KeyInfoType" combine="interleave">
       
    53             <zeroOrMore>
       
    54                 <choice>
       
    55                     <element name="EncryptedKey"><ref name="EncryptedKeyType"/></element>
       
    56                     <element name="AgreementMethod"><ref name="AgreementMethodType"/></element>
       
    57                 </choice>
       
    58             </zeroOrMore>    
       
    59         </define>
       
    60 
       
    61         <define name="DigestMethodType" combine="choice">
       
    62             <notAllowed/>
       
    63          </define>
       
    64 
       
    65         <define name="TransformType" combine="choice">
       
    66             <notAllowed/>
       
    67          </define>
       
    68 
       
    69     <!-- Now redefined in the include statement
       
    70         <define name="anyThing" combine="choice">
       
    71             <notAllowed/>
       
    72          </define>
       
    73     -->
       
    74 
       
    75     <!-- End import -->
       
    76         
       
    77   
       
    78     <define name="EncryptedDataType">
       
    79           <ref name="EncryptedType"/>
       
    80     </define>
       
    81   
       
    82   
       
    83     <define name="EncryptedKeyType">
       
    84             <ref name="EncryptedType"/>
       
    85             <optional><element name='ReferenceList'>
       
    86                 <ref name="ReferenceListType"/></element>
       
    87             </optional>
       
    88             <optional><element name='CarriedKeyName'><data type="string"/></element></optional>
       
    89             <optional><attribute name='Recipient'> <data type="string"/></attribute></optional>
       
    90     </define>
       
    91 
       
    92     
       
    93      <define name="EncryptedType">
       
    94         <element name="EncryptionMethod"><ref name="EncryptionMethodType"/></element>
       
    95         <optional>
       
    96             <element name="KeyInfo" ns="http://www.w3.org/2000/09/xmldsig#">
       
    97                 <ref name="KeyInfoType"/>
       
    98             </element>
       
    99         </optional>
       
   100         <optional>
       
   101             <element name="CipherData"><ref name="CipherDataType"/></element>
       
   102         </optional> 
       
   103         <optional>
       
   104              <element name="EncryptionProperties"><ref name="EncryptionPropertiesType"/></element>
       
   105         </optional>
       
   106         <optional><attribute name="Id"><data type="ID"/></attribute></optional>
       
   107         <optional><attribute name="Type"><data type="anyURI"/></attribute></optional>
       
   108         <optional><attribute name="MimeType"><data type="string"/></attribute></optional>
       
   109         <optional><attribute name="Encoding"><data type="anyURI"/></attribute></optional>
       
   110         <optional><attribute name='xsi:schemaLocation'/></optional>
       
   111     </define> 
       
   112 
       
   113     <define name="EncryptionMethodType">
       
   114         <zeroOrMore>
       
   115             <choice>
       
   116                 <element name="KeySize">
       
   117                     <data type="integer"/>
       
   118                 </element>
       
   119                 <element name="OAEPparams">
       
   120                     <data type="base64Binary"/>
       
   121                 </element>
       
   122                 <text/>
       
   123                 <element name='DigestMethod' ns="http://www.w3.org/2000/09/xmldsig#">
       
   124                     <ref name="DigestMethodType"/>
       
   125                 </element>
       
   126             </choice>
       
   127         </zeroOrMore>
       
   128         <attribute name="Algorithm"><data type="anyURI"/></attribute>
       
   129     </define>
       
   130 
       
   131             
       
   132     <define name="AgreementMethodType">
       
   133         <zeroOrMore>
       
   134             <choice>
       
   135                 <element name="KA-Nonce">
       
   136                     <data type="base64Binary"/>
       
   137                 </element>
       
   138                 <element name='DigestMethod' ns="http://www.w3.org/2000/09/xmldsig#">
       
   139                     <ref name="DigestMethodType"/>
       
   140                 </element>
       
   141                 <text/>
       
   142                 <element>
       
   143                     <nsName ns="http://www.w3.org/2000/09/xmldsig#"/>
       
   144                     <ref name="anyThing"/>
       
   145                 </element>
       
   146                 <element name="OriginatorKeyInfo"><ref name="KeyInfoType"/></element>
       
   147                 <element name="RecipientKeyInfo"><ref name="KeyInfoType"/></element>
       
   148             </choice>
       
   149         </zeroOrMore>
       
   150         <attribute name="Algorithm"><data type="anyURI"/></attribute>
       
   151     </define>            
       
   152             
       
   153             
       
   154     <define name="ReferenceListType">
       
   155         <oneOrMore>
       
   156             <choice>
       
   157                 <element name="DataReference">
       
   158                     <text/>
       
   159                     <attribute name="URI"><data type="anyURI"/></attribute>
       
   160                 </element>
       
   161                 <element name="KeyReference">
       
   162                     <text/>
       
   163                     <attribute name="URI"><data type="anyURI"/></attribute>
       
   164                 </element>
       
   165             </choice>
       
   166         </oneOrMore>
       
   167     </define>
       
   168     
       
   169     
       
   170     <define name="CipherDataType">
       
   171         <choice>
       
   172             <element name="CipherValue"><data type="base64Binary"/></element>
       
   173             <element name="CipherReference">
       
   174                 <element name="Transforms">
       
   175                   <oneOrMore>
       
   176                       <element name='Transform' ns="http://www.w3.org/2000/09/xmldsig#">
       
   177                           <ref name='TransformType'/>
       
   178                         </element>
       
   179                     </oneOrMore>
       
   180                 </element>
       
   181                 <attribute name="URI">
       
   182                     <data type="anyURI"/>
       
   183                 </attribute>      
       
   184             </element>
       
   185         </choice>
       
   186     </define>
       
   187     
       
   188     
       
   189     <define name="EncryptionPropertiesType">        
       
   190         <element name="EncryptionProperty">
       
   191           <zeroOrMore>
       
   192                 <element>
       
   193                     <anyName/>
       
   194                     <text/>
       
   195                 </element>
       
   196             </zeroOrMore>
       
   197             <optional>
       
   198                 <attribute name="Target">
       
   199                     <data type="anyURI"/>
       
   200                 </attribute>  
       
   201             </optional>
       
   202             <optional>                
       
   203                 <attribute name="Id">
       
   204                     <data type="ID"/>
       
   205                 </attribute>    
       
   206             </optional>
       
   207         </element>
       
   208         
       
   209         <optional>
       
   210             <attribute name="Id">
       
   211                 <data type="ID"/>
       
   212             </attribute>    
       
   213         </optional>
       
   214         <zeroOrMore>
       
   215             <attribute><nsName ns="http://www.w3.org/XML/1998/namespace"/></attribute>
       
   216         </zeroOrMore>
       
   217     </define>
       
   218 
       
   219 </grammar>