-1

Consider the XSD below borrowed from Wikipedia. Let's say I want to OPTIONALLY allow to encrypt any of the elements OR the whole address. How do I adapt the XSD using xmlenc-core1?

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Address">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Recipient" type="xs:string" />
        <xs:element name="House" type="xs:string" />
        <xs:element name="Street" type="xs:string" />
        <xs:element name="Town" type="xs:string" />
        <xs:element name="County" type="xs:string" minOccurs="0" />
        <xs:element name="PostCode" type="xs:string" />
        <xs:element name="Country" minOccurs="0">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="IN" />
              <xs:enumeration value="DE" />
              <xs:enumeration value="ES" />
              <xs:enumeration value="UK" />
              <xs:enumeration value="US" />
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
steros
  • 1,794
  • 2
  • 26
  • 60
  • This makes good reading (borrowed from http://www.w3.org/TR/xmlenc-core1/#sec-Usage) – jbutler483 Aug 19 '14 at 12:50
  • @jbutler thanks for the link but I read the spec already (more than once). This question is not about how I use XML Encryption, I know how to use it. This question is about how to adapt an xsd with it. – steros Aug 19 '14 at 15:04

1 Answers1

0

I would would start with having a choice for: and . Understand how the consuming stack will process the EncryptedData and then apply the same process to the sub elements.

Brent Schmaltz
  • 1,151
  • 6
  • 7