Explorar el Código

Added reporting functionality and tests

Stan Janssen hace 5 años
padre
commit
f174e1bb39
Se han modificado 60 ficheros con 8388 adiciones y 167 borrados
  1. BIN
      pyopenadr/__pycache__/__init__.cpython-37.pyc
  2. BIN
      pyopenadr/__pycache__/client.cpython-37.pyc
  3. BIN
      pyopenadr/__pycache__/config.cpython-37.pyc
  4. BIN
      pyopenadr/__pycache__/errors.cpython-37.pyc
  5. BIN
      pyopenadr/__pycache__/server.cpython-37.pyc
  6. BIN
      pyopenadr/__pycache__/utils.cpython-37.pyc
  7. 8 0
      pyopenadr/enums.py
  8. 3 3
      pyopenadr/service/__init__.py
  9. BIN
      pyopenadr/service/__pycache__/__init__.cpython-37.pyc
  10. BIN
      pyopenadr/service/__pycache__/event_service.cpython-37.pyc
  11. BIN
      pyopenadr/service/__pycache__/poll_service.cpython-37.pyc
  12. BIN
      pyopenadr/service/__pycache__/registration_service.cpython-37.pyc
  13. BIN
      pyopenadr/service/__pycache__/report_service.cpython-37.pyc
  14. BIN
      pyopenadr/service/__pycache__/vtn_service.cpython-37.pyc
  15. 10 0
      pyopenadr/templates/oadrCancelOpt.xml
  16. 10 0
      pyopenadr/templates/oadrCancelPartyRegistration.xml
  17. 11 0
      pyopenadr/templates/oadrCancelReport.xml
  18. 13 0
      pyopenadr/templates/oadrCanceledOpt.xml
  19. 14 0
      pyopenadr/templates/oadrCanceledPartyRegistration.xml
  20. 20 0
      pyopenadr/templates/oadrCanceledReport.xml
  21. 17 4
      pyopenadr/templates/oadrCreateOpt.xml
  22. 5 5
      pyopenadr/templates/oadrCreatePartyRegistration.xml
  23. 12 0
      pyopenadr/templates/oadrCreateReport.xml
  24. 2 2
      pyopenadr/templates/oadrCreatedEvent.xml
  25. 3 3
      pyopenadr/templates/oadrCreatedPartyRegistration.xml
  26. 20 0
      pyopenadr/templates/oadrCreatedReport.xml
  27. 1 1
      pyopenadr/templates/oadrPoll.xml
  28. 72 125
      pyopenadr/templates/oadrRegisterReport.xml
  29. 4 5
      pyopenadr/templates/oadrRegisteredReport.xml
  30. 0 0
      pyopenadr/templates/oadrRequestReport.xml
  31. 5 5
      pyopenadr/templates/oadrResponse.xml
  32. 33 0
      pyopenadr/templates/parts/eiActivePeriod.xml
  33. 22 0
      pyopenadr/templates/parts/eiEvent.xml
  34. 13 0
      pyopenadr/templates/parts/eiEventDescriptor.xml
  35. 35 0
      pyopenadr/templates/parts/eiEventSignal.xml
  36. 39 0
      pyopenadr/templates/parts/eiEventTarget.xml
  37. 27 0
      pyopenadr/templates/parts/eiTarget.xml
  38. 4 0
      pyopenadr/templates/parts/emixInterface.xml
  39. 50 0
      pyopenadr/templates/parts/oadrReportRequest.xml
  40. 57 12
      pyopenadr/utils.py
  41. 966 0
      schema/oadr_20b.xsd
  42. 223 0
      schema/oadr_ISO_ISO3AlphaCurrencyCode_20100407.xsd
  43. 238 0
      schema/oadr_atom.xsd
  44. 1012 0
      schema/oadr_ei_20b.xsd
  45. 33 0
      schema/oadr_emix_20b.xsd
  46. 42 0
      schema/oadr_gml_20b.xsd
  47. 3954 0
      schema/oadr_greenbutton.xsd
  48. 260 0
      schema/oadr_power_20b.xsd
  49. 52 0
      schema/oadr_pyld_20b.xsd
  50. 106 0
      schema/oadr_siscale_20b.xsd
  51. 36 0
      schema/oadr_strm_20b.xsd
  52. 129 0
      schema/oadr_xcal_20b.xsd
  53. 108 0
      schema/oadr_xml.xsd
  54. 24 0
      schema/oadr_xmldsig-properties-schema.xsd
  55. 239 0
      schema/oadr_xmldsig.xsd
  56. 120 0
      schema/oadr_xmldsig11.xsd
  57. 2 2
      setup.py
  58. 161 0
      test/test_message_conversion.py
  59. 171 0
      test/test_schema.py
  60. 2 0
      test_requirements.txt

BIN
pyopenadr/__pycache__/__init__.cpython-37.pyc


BIN
pyopenadr/__pycache__/client.cpython-37.pyc


BIN
pyopenadr/__pycache__/config.cpython-37.pyc


BIN
pyopenadr/__pycache__/errors.cpython-37.pyc


BIN
pyopenadr/__pycache__/server.cpython-37.pyc


BIN
pyopenadr/__pycache__/utils.cpython-37.pyc


+ 8 - 0
pyopenadr/enums.py

@@ -0,0 +1,8 @@
+# Some handy enums to use in your messages
+
+class READING_TYPE:
+
+class REPORT_TYPE:
+
+class REPORT_NAME:
+

+ 3 - 3
pyopenadr/service/__init__.py

@@ -3,9 +3,9 @@ from .. import config
 from ..utils import datetimeformat, timedeltaformat, booleanformat
 
 api = responder.API(templates_dir=config.TEMPLATE_DIR)
-api.jinja_env.filters['datetimeformat'] = datetimeformat
-api.jinja_env.filters['timedeltaformat'] = timedeltaformat
-api.jinja_env.filters['booleanformat'] = booleanformat
+api.templates._env.filters['datetimeformat'] = datetimeformat
+api.templates._env.filters['timedeltaformat'] = timedeltaformat
+api.templates._env.filters['booleanformat'] = booleanformat
 
 def handler(message_type):
     """

BIN
pyopenadr/service/__pycache__/__init__.cpython-37.pyc


BIN
pyopenadr/service/__pycache__/event_service.cpython-37.pyc


BIN
pyopenadr/service/__pycache__/poll_service.cpython-37.pyc


BIN
pyopenadr/service/__pycache__/registration_service.cpython-37.pyc


BIN
pyopenadr/service/__pycache__/report_service.cpython-37.pyc


BIN
pyopenadr/service/__pycache__/vtn_service.cpython-37.pyc


+ 10 - 0
pyopenadr/templates/oadrCancelOpt.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
+  <oadrSignedObject>
+    <oadrCancelOpt ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
+      <ei:optID>{{ opt_id }}</ei:optID>
+      <ei:venID>{{ ven_id }}</ei:venID>
+    </oadrCancelOpt>
+  </oadrSignedObject>
+</oadrPayload>

+ 10 - 0
pyopenadr/templates/oadrCancelPartyRegistration.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
+  <oadrSignedObject>
+    <oadrCancelPartyRegistration ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
+      <ei:registrationID>{{ registration_id }}</ei:registrationID>
+      <ei:venID>{{ ven_id }}</ei:venID>
+    </oadrCancelPartyRegistration>
+  </oadrSignedObject>
+</oadrPayload>

+ 11 - 0
pyopenadr/templates/oadrCancelReport.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
+  <oadrSignedObject>
+    <oadrCancelReport ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
+      <ei:reportRequestID>{{ report_request_id }}</ei:reportRequestID>
+      <reportToFollow xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ report_to_follow|booleanformat }}</reportToFollow>
+      <ei:venID>{{ ven_id }}</ei:venID>
+    </oadrCancelReport>
+  </oadrSignedObject>
+</oadrPayload>

+ 13 - 0
pyopenadr/templates/oadrCanceledOpt.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
+  <oadrSignedObject>
+    <oadrCanceledOpt ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <ei:eiResponse>
+        <ei:responseCode>{{ response.response_code }}</ei:responseCode>
+        <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
+        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
+      </ei:eiResponse>
+      <ei:optID>{{ opt_id }}</ei:optID>
+    </oadrCanceledOpt>
+  </oadrSignedObject>
+</oadrPayload>

+ 14 - 0
pyopenadr/templates/oadrCanceledPartyRegistration.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
+  <oadrSignedObject>
+    <oadrCanceledPartyRegistration ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <ei:eiResponse>
+        <ei:responseCode>{{ response.response_code }}</ei:responseCode>
+        <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
+        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
+      </ei:eiResponse>
+      <ei:registrationID>{{ registration_id }}</ei:registrationID>
+      <ei:venID>{{ ven_id }}</ei:venID>
+    </oadrCanceledPartyRegistration>
+  </oadrSignedObject>
+</oadrPayload>

+ 20 - 0
pyopenadr/templates/oadrCanceledReport.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
+  <oadrSignedObject>
+    <oadrCanceledReport ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <ei:eiResponse>
+        <ei:responseCode>{{ response.response_code }}</ei:responseCode>
+        <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
+        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
+      </ei:eiResponse>
+      <oadrPendingReports>
+        {% for pending_report in pending_reports %}
+        <ei:reportRequestID>{{ pending_report.request_id }}</ei:reportRequestID>
+        {% endfor %}
+      </oadrPendingReports>
+      {% if ven_id %}
+      <ei:venID>{{ ven_id }}</ei:venID>
+      {% endif %}
+    </oadrCanceledReport>
+  </oadrSignedObject>
+</oadrPayload>

+ 17 - 4
pyopenadr/templates/oadrCreateOpt.xml

@@ -1,13 +1,26 @@
 <?xml version="1.0" encoding="utf-8"?>
 <oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
   <oadrSignedObject>
-    <oadrCreateOpt ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
-      <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
+    <oadrCreateOpt ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06">
+      <ei:optID>{{ opt_id }}</ei:optID>
+      <ei:optType>{{ opt_type }}</ei:optType>
+      <ei:optReason>{{ opt_reason }}</ei:optReason>
+      {% if market_context %}
+      <emix:marketContext>{{ market_context }}</emix:marketContext>
+      {% endif %}
+      <ei:venID>{{ ven_id }}</ei:venID>
+      {% if vavailability %}
+      <xcal:vavailability></xcal:vavailability>
+      {% endif %}
+      <ei:createdDateTime>{{ created_date_time|datetimeformat }} </ei:createdDateTime>
+      <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
       <ei:qualifiedEventID>
         <ei:eventID>{{ event_id }}</ei:eventID>
         <ei:modificationNumber>{{ modification_number }}</ei:modificationNumber>
       </ei:qualifiedEventID>
+      {% for target in targets %}
       {% include 'parts/eiTarget.xml' %}
-    </oadrCreatedEvent>
+      {% endfor %}
+    </oadrCreateOpt>
   </oadrSignedObject>
-</oadrPayload>
+</oadrPayload>

+ 5 - 5
pyopenadr/templates/oadrCreatePartyRegistration.xml

@@ -3,16 +3,16 @@
   <oadrSignedObject>
     <oadrCreatePartyRegistration ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
       <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
-      <oadrProfileName>{{ profile_name }}</oadrProfileName>
       {% if ven_id %}
-      <venID>{{ ven_id }}</venID>
+      <ei:venID>{{ ven_id }}</ei:venID>
       {% endif %}
+      <oadrProfileName>{{ profile_name }}</oadrProfileName>
       <oadrTransportName>{{ transport_name }}</oadrTransportName>
       <oadrTransportAddress>{{ transport_address }}</oadrTransportAddress>
-      <oadrReportOnly>{{ report_only }}</oadrReportOnly>
-      <oadrXmlSignature>{{ xml_signature }}</oadrXmlSignature>
+      <oadrReportOnly>{{ report_only|booleanformat }}</oadrReportOnly>
+      <oadrXmlSignature>{{ xml_signature|booleanformat }}</oadrXmlSignature>
       <oadrVenName>{{ ven_name }}</oadrVenName>
-      <oadrHttpPullModel>{{ http_pull_model }}</oadrHttpPullModel>
+      <oadrHttpPullModel>{{ http_pull_model|booleanformat }}</oadrHttpPullModel>
     </oadrCreatePartyRegistration>
   </oadrSignedObject>
 </oadrPayload>

+ 12 - 0
pyopenadr/templates/oadrCreateReport.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07">
+  <oadrSignedObject>
+    <oadrCreateReport ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
+      {% for report_request in report_requests %}
+      {% include 'parts/oadrReportRequest.xml' %}
+      {% endfor %}
+      <ei:venID>{{ ven_id }}</ei:venID>
+    </oadrCreateReport>
+  </oadrSignedObject>
+</oadrPayload>

+ 2 - 2
pyopenadr/templates/oadrCreatedEvent.xml

@@ -20,8 +20,8 @@
             {% endif %}
             <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ event_response.request_id }}</requestID>
             <ei:qualifiedEventID>
-              <ei:eventID>{{ event_response.qualified_event_id.event_id }}</ei:eventID>
-              <ei:modificationNumber>{{ event_response.qualified_event_id.modification_number }}</ei:modificationNumber>
+              <ei:eventID>{{ event_response.event_id }}</ei:eventID>
+              <ei:modificationNumber>{{ event_response.modification_number }}</ei:modificationNumber>
             </ei:qualifiedEventID>
             <ei:optType>{{ event_response.opt_type }}</ei:optType>
           </ei:eventResponse>

+ 3 - 3
pyopenadr/templates/oadrCreatedPartyRegistration.xml

@@ -3,9 +3,9 @@
   <oadrSignedObject>
     <oadrCreatedPartyRegistration ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
       <ei:eiResponse>
-        <ei:responseCode>200</ei:responseCode>
-        <ei:responseDescription>OK</ei:responseDescription>
-        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
+        <ei:responseCode>{{ response.response_code }}</ei:responseCode>
+        <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
+        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
       </ei:eiResponse>
       {% if registration_id %}
       <ei:registrationID>{{ registration_id }}</ei:registrationID>

+ 20 - 0
pyopenadr/templates/oadrCreatedReport.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oadrPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openadr.org/oadr-2.0b/2012/07" xsi:schemaLocation="http://openadr.org/oadr-2.0b/2012/07 oadr_20b.xsd">
+  <oadrSignedObject>
+    <oadrCreatedReport ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+      <ei:eiResponse>
+        <ei:responseCode>{{ response.response_code }}</ei:responseCode>
+        <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
+        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
+      </ei:eiResponse>
+      <oadrPendingReports>
+        {% for pending_report in pending_reports %}
+        <ei:reportRequestID>{{ pending_report.request_id }}</ei:reportRequestID>
+        {% endfor %}
+      </oadrPendingReports>
+      {% if ven_id %}
+      <ei:venID>{{ ven_id }}</ei:venID>
+      {% endif %}
+    </oadrCreatedReport>
+  </oadrSignedObject>
+</oadrPayload>

+ 1 - 1
pyopenadr/templates/oadrPoll.xml

@@ -5,4 +5,4 @@
       <ei:venID>{{ ven_id }}</ei:venID>
     </oadrPoll>
   </oadrSignedObject>
-</oadrPayload>
+</oadrPayload>

+ 72 - 125
pyopenadr/templates/oadrRegisterReport.xml

@@ -3,147 +3,94 @@
   <oadrSignedObject>
     <oadrRegisterReport ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
       <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
-      <ei:venID>{{ ven_id }}</ei:venID>
 {% for report in reports %}
       <oadrReport>
-        <duration xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
-          <duration>{{ report.duration }}</duration>
-        </duration>
-    {% for rd report.description %}
+        <ei:eiReportID>{{ report.report_id }}</ei:eiReportID>
+    {% for rd in report.report_descriptions %}
         <oadrReportDescription>
-          <ei:rID>{{ rd.status }}</ei:rID>
+          <ei:rID>{{ rd.r_id }}</ei:rID>
+          {% if rd.report_subject %}
+          <ei:reportSubject>
+            {% set target = rd.report_subject %}
+            {% if target.emix_interfaces %}
+                {% for emix_interface in target.emix_interface %}
+                    {% include 'parts/emixInterface.xml' %}
+                {% endfor %}
+            {% endif %}
+
+            {% if target.group_id %}
+                <ei:groupID>{{ target.group_id }}</ei:groupID>
+            {% endif %}
+
+            {% if target.group_name %}
+                <ei:groupName>{{ target.group_name }}</ei:groupName>
+            {% endif %}
+
+            {% if target.resource_id %}
+                <ei:resourceID>{{ target.resource_id }}</ei:resourceID>
+            {% endif %}
+
+            {% if target.ven_id %}
+                <ei:venID>{{ target.ven_id }}</ei:venID>
+            {% endif %}
+
+            {% if target.party_id %}
+                <ei:partyID>{{ target.party_id }}</ei:partyID>
+            {% endif %}
+          </ei:reportSubject>
+          {% endif %}
+          {% if rd.report_data_source %}
           <ei:reportDataSource>
-            <ei:resourceID>{{ rd.resource_id }}</ei:resourceID>
+              {% set target = rd.report_data_source %}
+              {% if target.emix_interfaces %}
+                  {% for emix_interface in target.emix_interface %}
+                      {% include 'parts/emixInterface.xml' %}
+                  {% endfor %}
+              {% endif %}
+
+              {% if target.group_id %}
+                  <ei:groupID>{{ target.group_id }}</ei:groupID>
+              {% endif %}
+
+              {% if target.group_name %}
+                  <ei:groupName>{{ target.group_name }}</ei:groupName>
+              {% endif %}
+
+              {% if target.resource_id %}
+                  <ei:resourceID>{{ target.resource_id }}</ei:resourceID>
+              {% endif %}
+
+              {% if target.ven_id %}
+                  <ei:venID>{{ target.ven_id }}</ei:venID>
+              {% endif %}
+
+              {% if target.party_id %}
+                  <ei:partyID>{{ target.party_id }}</ei:partyID>
+              {% endif %}
           </ei:reportDataSource>
+          {% endif %}
           <ei:reportType>{{ rd.report_type }}</ei:reportType>
           <ei:readingType>{{ rd.reading_type }}</ei:readingType>
           <marketContext xmlns="http://docs.oasis-open.org/ns/emix/2011/06">{{ rd.market_context }}</marketContext>
           <oadrSamplingRate>
-            <oadrMinPeriod>{{ rd.sampling_rate.min_period }}</oadrMinPeriod>
-            <oadrMaxPeriod>{{ rd.sampling_rate.max_period }}</oadrMaxPeriod>
-            <oadrOnChange>{{ rd.sampling_rate.on_change }}</oadrOnChange>
+            <oadrMinPeriod>{{ rd.sampling_rate.min_period|timedeltaformat }}</oadrMinPeriod>
+            <oadrMaxPeriod>{{ rd.sampling_rate.max_period|timedeltaformat }}</oadrMaxPeriod>
+            <oadrOnChange>{{ rd.sampling_rate.on_change|booleanformat }}</oadrOnChange>
           </oadrSamplingRate>
         </oadrReportDescription>
     {% endfor %}
         <ei:reportRequestID>{{ report.report_request_id }}</ei:reportRequestID>
         <ei:reportSpecifierID>{{ report.report_specifier_id }}</ei:reportSpecifierID>
         <ei:reportName>{{ report.report_name }}</ei:reportName>
-        <ei:createdDateTime>{{ report.created_date_time }}</ei:createdDateTime>
-      </oadrReport>
-{% endfor %}
-
-
-
-
-
-      <oadrReport>
-        <duration xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
-          <duration>{{ duration }}</duration>
-        </duration>
-{% for report_description in reports %}
-        <oadrReportDescription>
-          <ei:rID>{{ report_description.r_id }}</ei:rID>
-          <ei:reportDataSource>
-            <ei:resourceID>{report_description.report_data_source.resource_id</ei:resourceID>
-          </ei:reportDataSource>
-          <ei:reportType>report_description.report_type</ei:reportType>
-          <energyReal xmlns="http://docs.oasis-open.org/ns/emix/2011/06/power">
-            <itemDescription>{{report_description.energy_real.item_descirption}}</itemDescription>
-            <itemUnits>{{ report_description.energy_real.item_units }}</itemUnits>
-            <siScaleCode xmlns="http://docs.oasis-open.org/ns/emix/2011/06/siscale">{{ report_descirption.energy_real.si_scale_code }}</siScaleCode>
-          </energyReal>
-          <ei:readingType>Direct Read</ei:readingType>
-          <marketContext xmlns="http://docs.oasis-open.org/ns/emix/2011/06">http://MarketContext1</marketContext>
-          <oadrSamplingRate>
-            <oadrMinPeriod>PT1M</oadrMinPeriod>
-            <oadrMaxPeriod>PT1M</oadrMaxPeriod>
-            <oadrOnChange>false</oadrOnChange>
-          </oadrSamplingRate>
-        </oadrReportDescription>
-{%
-        <oadrReportDescription>
-          <ei:rID>resource1_power</ei:rID>
-          <ei:reportDataSource>
-            <ei:resourceID>resource1</ei:resourceID>
-          </ei:reportDataSource>
-          <ei:reportType>usage</ei:reportType>
-          <powerReal xmlns="http://docs.oasis-open.org/ns/emix/2011/06/power">
-            <itemDescription>RealPower</itemDescription>
-            <itemUnits>W</itemUnits>
-            <siScaleCode xmlns="http://docs.oasis-open.org/ns/emix/2011/06/siscale">n</siScaleCode>
-            <powerAttributes>
-              <hertz>60</hertz>
-              <voltage>110</voltage>
-              <ac>false</ac>
-            </powerAttributes>
-          </powerReal>
-          <ei:readingType>Direct Read</ei:readingType>
-          <marketContext xmlns="http://docs.oasis-open.org/ns/emix/2011/06">http://MarketContext1</marketContext>
-          <oadrSamplingRate>
-            <oadrMinPeriod>PT1M</oadrMinPeriod>
-            <oadrMaxPeriod>PT1M</oadrMaxPeriod>
-            <oadrOnChange>false</oadrOnChange>
-          </oadrSamplingRate>
-        </oadrReportDescription>
-        <ei:reportRequestID>0</ei:reportRequestID>
-        <ei:reportSpecifierID>789ed6cd4e_telemetry_usage</ei:reportSpecifierID>
-        <ei:reportName>METADATA_TELEMETRY_USAGE</ei:reportName>
-        <ei:createdDateTime>2019-06-04T10:59:35.6533057Z</ei:createdDateTime>
+        <ei:createdDateTime>{{ report.created_date_time|datetimeformat }}</ei:createdDateTime>
       </oadrReport>
-      <oadrReport>
-        <duration xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
-          <duration>PT2H</duration>
-        </duration>
-        <oadrReportDescription>
-          <ei:rID>resource1_energy</ei:rID>
-          <ei:reportDataSource>
-            <ei:resourceID>resource1</ei:resourceID>
-          </ei:reportDataSource>
-          <ei:reportType>usage</ei:reportType>
-          <energyReal xmlns="http://docs.oasis-open.org/ns/emix/2011/06/power">
-            <itemDescription>RealEnergy</itemDescription>
-            <itemUnits>Wh</itemUnits>
-            <siScaleCode xmlns="http://docs.oasis-open.org/ns/emix/2011/06/siscale">n</siScaleCode>
-          </energyReal>
-          <ei:readingType>Direct Read</ei:readingType>
-          <marketContext xmlns="http://docs.oasis-open.org/ns/emix/2011/06">http://MarketContext1</marketContext>
-          <oadrSamplingRate>
-            <oadrMinPeriod>PT1M</oadrMinPeriod>
-            <oadrMaxPeriod>PT1M</oadrMaxPeriod>
-            <oadrOnChange>false</oadrOnChange>
-          </oadrSamplingRate>
-        </oadrReportDescription>
 {% endfor %}
-        <oadrReportDescription>
-          <ei:rID>resource1_power</ei:rID>
-          <ei:reportDataSource>
-            <ei:resourceID>resource1</ei:resourceID>
-          </ei:reportDataSource>
-          <ei:reportType>usage</ei:reportType>
-          <powerReal xmlns="http://docs.oasis-open.org/ns/emix/2011/06/power">
-            <itemDescription>RealPower</itemDescription>
-            <itemUnits>W</itemUnits>
-            <siScaleCode xmlns="http://docs.oasis-open.org/ns/emix/2011/06/siscale">n</siScaleCode>
-            <powerAttributes>
-              <hertz>60</hertz>
-              <voltage>110</voltage>
-              <ac>false</ac>
-            </powerAttributes>
-          </powerReal>
-          <ei:readingType>Direct Read</ei:readingType>
-          <marketContext xmlns="http://docs.oasis-open.org/ns/emix/2011/06">http://MarketContext1</marketContext>
-          <oadrSamplingRate>
-            <oadrMinPeriod>PT1M</oadrMinPeriod>
-            <oadrMaxPeriod>PT1M</oadrMaxPeriod>
-            <oadrOnChange>false</oadrOnChange>
-          </oadrSamplingRate>
-        </oadrReportDescription>
-        <ei:reportRequestID>0</ei:reportRequestID>
-        <ei:reportSpecifierID>789ed6cd4e_history_usage</ei:reportSpecifierID>
-        <ei:reportName>METADATA_HISTORY_USAGE</ei:reportName>
-        <ei:createdDateTime>2019-06-04T10:59:35.6533057Z</ei:createdDateTime>
-      </oadrReport>
-      <ei:venID>95a3c2f9068725320753</ei:venID>
+      {% if ven_id %}
+      <ei:venID>{{ ven_id }}</ei:venID>
+      {% endif %}
+      {% if report_request_id %}
+      <ei:reportRequestID>{{ report_request_id }}</ei:reportRequestID>
+      {% endif %}
     </oadrRegisterReport>
   </oadrSignedObject>
-</oadrPayload>
+</oadrPayload>

+ 4 - 5
pyopenadr/templates/oadrRegisteredReport.xml

@@ -7,11 +7,10 @@
         <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
         <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
       </ei:eiResponse>
-    {% for report_request in report_requests %}
-      <oadrReportRequest>
-      </oadrReportRequest>
-    {% endfor %}
+      {% for report_request in report_requests %}
+      {% include 'parts/oadrReportRequest.xml' %}
+      {% endfor %}
       <ei:venID>{{ ven_id }}</ei:venID>
     </oadrRegisteredReport>
   </oadrSignedObject>
-</oadrPayload>
+</oadrPayload>

+ 0 - 0
pyopenadr/templates/oadrRequestReport.xml


+ 5 - 5
pyopenadr/templates/oadrResponse.xml

@@ -3,10 +3,10 @@
   <oadrSignedObject>
     <oadrResponse ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
       <ei:eiResponse>
-        <ei:responseCode>{{ response_code }}</ei:responseCode>
-        <ei:responseDescription>{{ response_description }}</ei:responseDescription>
-        {% if request_id %}
-        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
+        <ei:responseCode>{{ response.response_code }}</ei:responseCode>
+        <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
+        {% if response.request_id %}
+        <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
         {% else %}
         <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" />
         {% endif %}
@@ -14,4 +14,4 @@
       <ei:venID>{{ ven_id }}</ei:venID>
     </oadrResponse>
   </oadrSignedObject>
-</oadrPayload>
+</oadrPayload>

+ 33 - 0
pyopenadr/templates/parts/eiActivePeriod.xml

@@ -0,0 +1,33 @@
+<ei:eiActivePeriod>
+    <properties xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+        <dtstart>
+            <date-time>{{ event.active_period.dtstart|datetimeformat }}</date-time>
+        </dtstart>
+        <duration>
+            <duration>{{ event.active_period.duration|timedeltaformat }}</duration>
+        </duration>
+        {% if event.active_period.tolerance %}
+        <tolerance>
+            <tolerate>
+                <startafter>{{ event.active_period.tolerance.startafter|timedeltaformat }}</startafter>
+            </tolerate>
+        </tolerance>
+        {% endif %}
+        {% if event.active_period.notification %}
+        <ei:x-eiNotification>
+            <duration>{{ event.active_period.notification|timedeltaformat }}</duration>
+        </ei:x-eiNotification>
+        {% endif %}
+        {% if event.active_period.ramp_up %}
+        <ei:x-eiRampUp>
+            <duration>{{ event.active_period.ramp_up|timedeltaformat }}</duration>
+        </ei:x-eiRampUp>
+        {% endif %}
+        {% if event.active_period.recovery %}
+        <ei:x-eiRecovery>
+            <duration>{{ event.active_period.recovery|timedeltaformat }}</duration>
+        </ei:x-eiRecovery>
+        {% endif %}
+    </properties>
+    <components xsi:nil="true" xmlns="urn:ietf:params:xml:ns:icalendar-2.0" />
+</ei:eiActivePeriod>

+ 22 - 0
pyopenadr/templates/parts/eiEvent.xml

@@ -0,0 +1,22 @@
+<oadrEvent>
+    <ei:eiEvent>
+        {% include 'parts/eiEventDescriptor.xml' %}
+        {% include 'parts/eiActivePeriod.xml' %}
+        <ei:eiEventSignals>
+            {% for signal in event.event_signals %}
+                {% include 'parts/eiEventSignal.xml' %}
+            {% endfor %}
+        </ei:eiEventSignals>
+        {% if event.report_requests %}
+        <ei:eiReportRequests>
+            {% for report_request in event.report_requests %}
+            {% include 'parts/eiReportRequest.xml' %}
+            {% endfor %}
+        </ns1>
+        {% endif %}
+        {% if event.targets %}
+        {% include 'parts/eiEventTarget.xml' %}
+        {% endif %}
+    </ei:eiEvent>
+    <oadrResponseRequired>{{ event.response_required }}</oadrResponseRequired>
+</oadrEvent>

+ 13 - 0
pyopenadr/templates/parts/eiEventDescriptor.xml

@@ -0,0 +1,13 @@
+<ei:eventDescriptor>
+    <ei:eventID>{{ event.event_descriptor.event_id }}</ei:eventID>
+    <ei:modificationNumber>{{ event.event_descriptor.modification_number }}</ei:modificationNumber>
+    <ei:modificationDateTime>{{ event.event_descriptor.modification_date_time|datetimeformat }}</ei:modificationDateTime>
+    <ei:priority>{{ event.event_descriptor.priority }}</ei:priority>
+    <ei:eiMarketContext>
+        <marketContext xmlns="http://docs.oasis-open.org/ns/emix/2011/06">{{ event.event_descriptor.market_context }}</marketContext>
+    </ei:eiMarketContext>
+    <ei:createdDateTime>{{ event.event_descriptor.created_date_time|datetimeformat }}</ei:createdDateTime>
+    <ei:eventStatus>{{ event.event_descriptor.event_status }}</ei:eventStatus>
+    <ei:testEvent>{{ event.event_descriptor.test_event|booleanformat }}</ei:testEvent>
+    <ei:vtnComment>{{ event.event_descriptor.vtn_comment }}</ei:vtnComment>
+</ei:eventDescriptor>

+ 35 - 0
pyopenadr/templates/parts/eiEventSignal.xml

@@ -0,0 +1,35 @@
+<ei:eiEventSignal>
+    <intervals xmlns="urn:ietf:params:xml:ns:icalendar-2.0:stream">
+    {% for interval in signal.intervals %}
+        <ei:interval>
+            <duration xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+                <duration>{{ interval.duration|timedeltaformat }}</duration>
+            </duration>
+            <uid xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+                <text>{{ interval.uid }}</text>
+            </uid>
+            <ei:signalPayload>
+                <ei:payloadFloat>
+                    <ei:value>{{ interval.signal_payload }}</ei:value>
+                </ei:payloadFloat>
+            </ei:signalPayload>
+        </ei:interval>
+    {% endfor %}
+    </intervals>
+    <ei:signalName>{{ signal.signal_name }}</ei:signalName>
+    <ei:signalType>{{ signal.signal_type }}</ei:signalType>
+    <ei:signalID>{{ signal.signal_id }}</ei:signalID>
+    {% if signal.current_value %}
+    <ei:currentValue>
+        <ei:payloadFloat>
+            <ei:value>{{ signal.current_value }}</ei:value>
+        </ei:payloadFloat>
+    </ei:currentValue>
+    {% else %}
+    <ei:currentValue>
+        <ei:payloadFloat>
+            <ei:value>12.34</ei:value>
+        </ei:payloadFloat>
+    </ei:currentValue>
+    {% endif %}
+</ei:eiEventSignal>

+ 39 - 0
pyopenadr/templates/parts/eiEventTarget.xml

@@ -0,0 +1,39 @@
+<ei:eiTarget>
+    {% for target in event.targets %}
+        {% if target.emix_interfaces %}
+            {% for emix_interface in target.emix_interface %}
+                {% include 'parts/emixInterface.xml' %}
+            {% endfor %}
+        {% endif %}
+    {% endfor %}
+
+    {% for target in event.targets %}
+        {% if target.group_id %}
+            <ei:groupID>{{ target.group_id }}</ei:groupID>
+        {% endif %}
+    {% endfor %}
+
+    {% for target in event.targets %}
+        {% if target.group_name %}
+            <ei:groupName>{{ target.group_name }}</ei:groupName>
+        {% endif %}
+    {% endfor %}
+
+    {% for target in event.targets %}
+        {% if target.resource_id %}
+            <ei:resourceID>{{ target.resource_id }}</ei:resourceID>
+        {% endif %}
+    {% endfor %}
+
+    {% for target in event.targets %}
+        {% if target.ven_id %}
+            <ei:venID>{{ target.ven_id }}</ei:venID>
+        {% endif %}
+    {% endfor %}
+
+    {% for target in event.targets %}
+        {% if target.party_id %}
+            <ei:partyID>{{ target.party_id }}</ei:partyID>
+        {% endif %}
+    {% endfor %}
+</ei:eiTarget>

+ 27 - 0
pyopenadr/templates/parts/eiTarget.xml

@@ -0,0 +1,27 @@
+<ei:eiTarget>
+    {% if target.emix_interfaces %}
+        {% for emix_interface in target.emix_interface %}
+            {% include 'parts/emixInterface.xml' %}
+        {% endfor %}
+    {% endif %}
+
+    {% if target.group_id %}
+        <ei:groupID>{{ target.group_id }}</ei:groupID>
+    {% endif %}
+
+    {% if target.group_name %}
+        <ei:groupName>{{ target.group_name }}</ei:groupName>
+    {% endif %}
+
+    {% if target.resource_id %}
+        <ei:resourceID>{{ target.resource_id }}</ei:resourceID>
+    {% endif %}
+
+    {% if target.ven_id %}
+        <ei:venID>{{ target.ven_id }}</ei:venID>
+    {% endif %}
+
+    {% if target.party_id %}
+        <ei:partyID>{{ target.party_id }}</ei:partyID>
+    {% endif %}
+</ei:eiTarget>

+ 4 - 0
pyopenadr/templates/parts/emixInterface.xml

@@ -0,0 +1,4 @@
+<ei:marketContext></ei:marketContext>
+<ei:serviceArea>
+    <FeatureCollection xmlns:gml="http://www.opengis.net/gml/3.2">
+</ei:serviceArea>

+ 50 - 0
pyopenadr/templates/parts/oadrReportRequest.xml

@@ -0,0 +1,50 @@
+<oadrReportRequest>
+  <ei:reportRequestID>{{ report_request.report_request_id }}</ei:reportRequestID>
+  <ei:reportSpecifier xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0">
+    <ei:reportSpecifierID>{{ report_request.report_specifier.report_specifier_id }}</ei:reportSpecifierID>
+    <xcal:granularity>
+      <xcal:duration>{{ report_request.report_specifier.granularity|timedeltaformat }}</xcal:duration>
+    </xcal:granularity>
+    <ei:reportBackDuration>
+      <xcal:duration>{{ report_request.report_specifier.report_back_duration|timedeltaformat }}</xcal:duration>
+    </ei:reportBackDuration>
+    {% if report_request.report_specifier.report_interval %}
+    <ei:reportInterval>
+      <xcal:properties>
+        <xcal:dtstart>
+          <xcal:date-time>{{ report_request.report_specifier.report_interval.dtstart|datetimeformat }}</xcal:date-time>
+        </xcal:dtstart>
+        <xcal:duration>
+          <xcal:duration>{{ report_request.report_specifier.report_interval.duration|timedeltaformat }}</xcal:duration>
+        </xcal:duration>
+        {% if report_request.report_specifier.report_interval.tolerance %}
+        <xcal:tolerance>
+          <xcal:tolerate>
+            <xcal:startafter>{{ report_request.report_specifier.report_interval.tolerance.tolerate.startafter|timedeltaformat }}</xcal:startafter>
+          </xcal:tolerate>
+        </xcal:tolerance>
+        {% endif %}
+        {% if report_request.report_specifier.report_interval.notification %}
+        <ei:x-eiNotification>
+          <xcal:duration>{{ report_request.report_specifier.report_interval.notification|timedeltaformat }}</xcal:duration>
+        </ei:x-eiNotification>
+        {% endif %}
+        {% if report_request.report_specifier.report_interval.ramp_up %}
+        <ei:x-eiRampUp>
+          <xcal:duration>{{ report_request.report_specifier.report_interval.ramp_up|timedeltaformat }}</xcal:duration>
+        </ei:x-eiRampUp>
+        {% endif %}
+        {% if report_request.report_specifier.report_interval.recovery %}
+        <ei:x-eiRecovery>
+          <xcal:duration>{{ report_request.report_specifier.report_interval.recovery|timedeltaformat }}</xcal:duration>
+        </ei:x-eiRecovery>
+        {% endif %}
+      </xcal:properties>
+    </ei:reportInterval>
+    {% endif %}
+    <ei:specifierPayload>
+      <ei:rID>{{ report_request.report_specifier.specifier_payload.r_id }}</ei:rID>
+      <ei:readingType>{{ report_request.report_specifier.specifier_payload.reading_type }}</ei:readingType>
+    </ei:specifierPayload>
+  </ei:reportSpecifier>
+</oadrReportRequest>

+ 57 - 12
pyopenadr/utils.py

@@ -58,6 +58,7 @@ def normalize_dict(ordered_dict):
         """
         Parse a RFC5545 duration.
         """
+        # TODO: implement the full regex: matches = re.match(r'(\+|\-)?P((\d+Y)?(\d+M)?(\d+D)?T?(\d+H)?(\d+M)?(\d+S)?)|(\d+W)', value)
         matches = re.match(r'P(\d+(?:D|W))?T(\d+H)?(\d+M)?(\d+S)?', value)
         if not matches:
             return False
@@ -102,6 +103,7 @@ def normalize_dict(ordered_dict):
         if key.startswith("@"):
             continue
         key = normalize_key(key)
+
         if isinstance(value, OrderedDict):
             d[key] = normalize_dict(value)
         elif isinstance(value, list):
@@ -112,7 +114,7 @@ def normalize_dict(ordered_dict):
                     d[key].append(normalize_dict(dict_item))
                 else:
                     d[key].append(item)
-        elif key in ("duration", "startafter") and isinstance(value, str):
+        elif key in ("duration", "startafter", "max_period", "min_period") and isinstance(value, str):
             d[key] = parse_duration(value) or value
         elif "date_time" in key and isinstance(value, str):
             d[key] = parse_datetime(value)
@@ -132,12 +134,18 @@ def normalize_dict(ordered_dict):
         if key == "target":
             targets = d.pop("target")
             new_targets = []
-            for key in targets:
-                if isinstance(targets[key], list):
-                    new_targets.extend([{key: value} for value in targets[key]])
+            for ikey in targets:
+                if isinstance(targets[ikey], list):
+                    new_targets.extend([{ikey: value} for value in targets[ikey]])
                 else:
-                    new_targets.append({key: targets[key]})
+                    new_targets.append({ikey: targets[ikey]})
             d["targets"] = new_targets
+            key = "targets"
+
+        # Group all reports as a list of dicts under the key "pending_reports"
+        if key == "pending_reports":
+            if isinstance(d[key], dict) and 'report_request_id' in d[key] and isinstance(d[key]['report_request_id'], list):
+                d['pending_reports'] = [{'request_id': rrid} for rrid in d['pending_reports']['report_request_id']]
 
         # Group all events al a list of dicts under the key "events"
         elif key == "event" and isinstance(d[key], list):
@@ -151,14 +159,48 @@ def normalize_dict(ordered_dict):
 
         # If there's only one event, also put it into a list
         elif key == "event" and isinstance(d[key], dict) and "event" in d[key]:
-            d["events"] = [d.pop('event')['event']]
+            oadr_event = d.pop('event')
+            ei_event = oadr_event['event']
+            ei_event['response_required'] = oadr_event['response_required']
+            d['events'] = [ei_event]
 
         elif key in ("request_event", "created_event") and isinstance(d[key], dict):
             d = d[key]
 
+        elif key == 'report_request':
+            if isinstance(d[key], list):
+                d['report_requests'] = d.pop('report_request')
+            else:
+                d['report_requests'] = [d.pop('report_request')]
+
+        elif key == 'report_description':
+            if isinstance(d[key], list):
+                d['report_descriptions'] = d.pop('report_description')
+            else:
+                d['report_descriptions'] = [d.pop('report_description')]
+
+        elif key == 'report':
+            if isinstance(d[key], list):
+                d['reports'] = d.pop('report')
+            else:
+                d['reports'] = [d.pop('report')]
+
+        # Promote the contents of the Qualified Event ID
+        elif key == "qualified_event_id" and isinstance(d['qualified_event_id'], dict):
+            qeid = d.pop('qualified_event_id')
+            d['event_id'] = qeid['event_id']
+            d['modification_number'] = qeid['modification_number']
+
+        # Promote the contents of the tolerance items
+        # if key == "tolerance" and "tolerate" in d["tolerance"] and len(d["tolerance"]["tolerate"]) == 1:
+        #     d["tolerance"] = d["tolerance"]["tolerate"].values()[0]
+
         # Durations are encapsulated in their own object, remove this nesting
         elif isinstance(d[key], dict) and "duration" in d[key] and len(d[key]) == 1:
-            d[key] = d[key]["duration"]
+            try:
+                d[key] = d[key]["duration"]
+            except:
+                breakpoint()
 
         # In general, remove all double nesting
         elif isinstance(d[key], dict) and key in d[key] and len(d[key]) == 1:
@@ -185,6 +227,14 @@ def normalize_dict(ordered_dict):
         elif isinstance(d[key], dict) and "text" in d[key] and len(d[key]) == 1:
             d[key] = d[key]["text"]
 
+        # Promote a 'date-time' item
+        elif isinstance(d[key], dict) and "date_time" in d[key] and len(d[key]) == 1:
+            d[key] = d[key]["date_time"]
+
+        # Promote 'properties' item
+        elif isinstance(d[key], dict) and "properties" in d[key] and len(d[key]) == 1:
+            d[key] = d[key]["properties"]
+
         # Remove all empty dicts
         elif isinstance(d[key], dict) and len(d[key]) == 0:
             d.pop(key)
@@ -199,11 +249,6 @@ def parse_message(data):
     return message_type, normalize_dict(message_payload)
 
 def create_message(message_type, **message_payload):
-    for key, value in message_payload.items():
-        if isinstance(value, bool):
-            message_payload[key] = str(value).lower()
-        if isinstance(value, datetime):
-            message_payload[key] = value.strftime("%Y-%m-%dT%H:%M:%S%z")
     template = TEMPLATES.get_template(f'{message_type}.xml')
     return indent_xml(template.render(**message_payload))
 

+ 966 - 0
schema/oadr_20b.xsd

@@ -0,0 +1,966 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- edited with XMLSpy v2010 rel. 3 (x64) (http://www.altova.com) by James Zuber (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dsig11="http://www.w3.org/2009/xmldsig11#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:oadr="http://openadr.org/oadr-2.0b/2012/07" xmlns:clm5ISO42173A="urn:un:unece:uncefact:codelist:standard:5:ISO42173A:2010-04-07" xmlns:pyld="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110" xmlns:scale="http://docs.oasis-open.org/ns/emix/2011/06/siscale" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" xmlns:strm="urn:ietf:params:xml:ns:icalendar-2.0:stream" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:power="http://docs.oasis-open.org/ns/emix/2011/06/power" xmlns:gb="http://naesb.org/espi" xmlns:atom="http://www.w3.org/2005/Atom" targetNamespace="http://openadr.org/oadr-2.0b/2012/07" elementFormDefault="qualified" attributeFormDefault="qualified">
+	<xs:import namespace="urn:ietf:params:xml:ns:icalendar-2.0:stream" schemaLocation="oadr_strm_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/energyinterop/201110" schemaLocation="oadr_ei_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" schemaLocation="oadr_pyld_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06" schemaLocation="oadr_emix_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06/siscale" schemaLocation="oadr_siscale_20b.xsd"/>
+	<xs:import namespace="urn:ietf:params:xml:ns:icalendar-2.0" schemaLocation="oadr_xcal_20b.xsd"/>
+	<xs:import namespace="urn:un:unece:uncefact:codelist:standard:5:ISO42173A:2010-04-07" schemaLocation="oadr_ISO_ISO3AlphaCurrencyCode_20100407.xsd"/>
+	<xs:import namespace="http://naesb.org/espi" schemaLocation="oadr_greenbutton.xsd"/>
+	<xs:import namespace="http://www.w3.org/2005/Atom" schemaLocation="oadr_atom.xsd"/>
+	<xs:import namespace="http://www.w3.org/2009/xmldsig11#" schemaLocation="oadr_xmldsig11.xsd"/>
+	<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="oadr_xmldsig.xsd"/>
+	<!--  ******* oadrPayload  ******** -->
+	<!--   Root element for all payloads  -->
+	<xs:element name="oadrPayload">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="ds:Signature" minOccurs="0"/>
+				<xs:element ref="oadr:oadrSignedObject"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<!--  ******* oadrSignedObject  ******** -->
+	<!--  The URI attribute of the XML signature Reference element should point to this object (#oadr:oadrSignedObject) -->
+	<xs:element name="oadrSignedObject">
+		<xs:complexType>
+			<xs:choice>
+				<xs:element ref="oadr:oadrDistributeEvent"/>
+				<xs:element ref="oadr:oadrCreatedEvent"/>
+				<xs:element ref="oadr:oadrRequestEvent"/>
+				<xs:element ref="oadr:oadrResponse"/>
+				<xs:element ref="oadr:oadrCancelOpt"/>
+				<xs:element ref="oadr:oadrCanceledOpt"/>
+				<xs:element ref="oadr:oadrCreateOpt"/>
+				<xs:element ref="oadr:oadrCreatedOpt"/>
+				<xs:element ref="oadr:oadrCancelReport"/>
+				<xs:element ref="oadr:oadrCanceledReport"/>
+				<xs:element ref="oadr:oadrCreateReport"/>
+				<xs:element ref="oadr:oadrCreatedReport"/>
+				<xs:element ref="oadr:oadrRegisterReport"/>
+				<xs:element ref="oadr:oadrRegisteredReport"/>
+				<xs:element ref="oadr:oadrUpdateReport"/>
+				<xs:element ref="oadr:oadrUpdatedReport"/>
+				<xs:element ref="oadr:oadrCancelPartyRegistration"/>
+				<xs:element ref="oadr:oadrCanceledPartyRegistration"/>
+				<xs:element ref="oadr:oadrCreatePartyRegistration"/>
+				<xs:element ref="oadr:oadrCreatedPartyRegistration"/>
+				<xs:element ref="oadr:oadrRequestReregistration"/>
+				<xs:element ref="oadr:oadrQueryRegistration"/>
+				<xs:element ref="oadr:oadrPoll"/>
+			</xs:choice>
+			<xs:attribute name="Id" type="xs:ID" use="optional"/>
+		</xs:complexType>
+	</xs:element>
+	<!-- ##### EVENT PAYLOADS ##### -->
+	<!--  ******* oadrDistributeEvent ******** -->
+	<xs:element name="oadrDistributeEvent" type="oadr:oadrDistributeEventType">
+		<xs:annotation>
+			<xs:documentation>Send DR Events to a VEN</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrDistributeEventType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse" minOccurs="0"/>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="ei:vtnID"/>
+			<xs:element name="oadrEvent" minOccurs="0" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>An object containing a demand response event</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element ref="ei:eiEvent"/>
+						<xs:element ref="oadr:oadrResponseRequired"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrCreatedEvent ******** -->
+	<xs:element name="oadrCreatedEvent" type="oadr:oadrCreatedEventType"/>
+	<xs:complexType name="oadrCreatedEventType">
+		<xs:sequence>
+			<xs:element ref="pyld:eiCreatedEvent"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrRequestEvent ******** -->
+	<xs:element name="oadrRequestEvent" type="oadr:oadrRequestEventType"/>
+	<xs:complexType name="oadrRequestEventType">
+		<xs:sequence>
+			<xs:element ref="pyld:eiRequestEvent"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrResponse ******** -->
+	<xs:element name="oadrResponse" type="oadr:oadrResponseType"/>
+	<xs:complexType name="oadrResponseType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!-- ##### OPT PAYLOADS ##### -->
+	<!--  ****** oadrCancelOpt ******** -->
+	<xs:element name="oadrCancelOpt" type="oadr:oadrCancelOptType">
+		<xs:annotation>
+			<xs:documentation>Cancel an opt schedule</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCancelOptType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="ei:optID"/>
+			<xs:element ref="ei:venID"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrCanceledOpt ******** -->
+	<xs:element name="oadrCanceledOpt" type="oadr:oadrCanceledOptType">
+		<xs:annotation>
+			<xs:documentation>Acknowledge cancelation of an opt schedule</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCanceledOptType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="ei:optID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrCreateOpt ******** -->
+	<xs:element name="oadrCreateOpt" type="oadr:oadrCreateOptType">
+		<xs:annotation>
+			<xs:documentation>Create an optIn or optOut schedule</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCreateOptType">
+		<xs:complexContent>
+			<xs:extension base="ei:EiOptType">
+				<xs:sequence>
+					<xs:element ref="pyld:requestID"/>
+					<xs:element ref="ei:qualifiedEventID" minOccurs="0"/>
+					<xs:element ref="ei:eiTarget"/>
+					<xs:element ref="oadr:oadrDeviceClass" minOccurs="0"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!--  ****** oadrCreatedOpt ******** -->
+	<xs:element name="oadrCreatedOpt" type="oadr:oadrCreatedOptType">
+		<xs:annotation>
+			<xs:documentation>Acknowledge receipt of an opt schedule</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCreatedOptType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="ei:optID"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!-- ##### REPORT PAYLOADS ##### -->
+	<!--  ****** oadrCancelReport ******** -->
+	<xs:element name="oadrCancelReport" type="oadr:oadrCancelReportType">
+		<xs:annotation>
+			<xs:documentation>Cancel a report</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCancelReportType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="ei:reportRequestID" maxOccurs="unbounded"/>
+			<xs:element ref="pyld:reportToFollow"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrCanceledReport ******** -->
+	<xs:element name="oadrCanceledReport" type="oadr:oadrCanceledReportType"/>
+	<xs:complexType name="oadrCanceledReportType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="oadr:oadrPendingReports"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrCreateReport ******** -->
+	<xs:element name="oadrCreateReport" type="oadr:oadrCreateReportType">
+		<xs:annotation>
+			<xs:documentation>Request report from other party</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCreateReportType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="oadr:oadrReportRequest" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Request report</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrCreatedReport ******** -->
+	<xs:element name="oadrCreatedReport" type="oadr:oadrCreatedReportType">
+		<xs:annotation>
+			<xs:documentation>Acknowledge the request for report was received</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCreatedReportType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="oadr:oadrPendingReports">
+				<xs:annotation>
+					<xs:documentation>List of periodic reports that have not yet been delivered</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrRegisterReport ******** -->
+	<xs:element name="oadrRegisterReport" type="oadr:oadrRegisterReportType">
+		<xs:annotation>
+			<xs:documentation>Register Metadata report settings with other party</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrRegisterReportType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="oadr:oadrReport" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+			<xs:element ref="ei:reportRequestID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrRegisteredReport ******** -->
+	<xs:element name="oadrRegisteredReport" type="oadr:oadrRegisteredReportType">
+		<xs:annotation>
+			<xs:documentation>Acknowledge registration of Metadata report by other party</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrRegisteredReportType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="oadr:oadrReportRequest" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrUpdateReport ******** -->
+	<xs:element name="oadrUpdateReport" type="oadr:oadrUpdateReportType">
+		<xs:annotation>
+			<xs:documentation>Send a previously requested report</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrUpdateReportType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="oadr:oadrReport" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ****** oadrUpdatedReport ******** -->
+	<xs:element name="oadrUpdatedReport" type="oadr:oadrUpdatedReportType">
+		<xs:annotation>
+			<xs:documentation>Acknowledge receipt of a report</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrUpdatedReportType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="oadr:oadrCancelReport" minOccurs="0"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!-- ##### REGESTRATION PAYLOADS ##### -->
+	<!--  ******* oadrCancelPartyRegistration ******** -->
+	<xs:element name="oadrCancelPartyRegistration" type="oadr:oadrCancelPartyRegistrationType">
+		<xs:annotation>
+			<xs:documentation>Cancel a registration</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCancelPartyRegistrationType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="ei:registrationID"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrCanceledPartyRegistration ******** -->
+	<xs:element name="oadrCanceledPartyRegistration" type="oadr:oadrCanceledPartyRegistrationType">
+		<xs:annotation>
+			<xs:documentation>Acknowledge cancelation of registration</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCanceledPartyRegistrationType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="ei:registrationID" minOccurs="0"/>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrCreatePartyRegistration ******** -->
+	<xs:element name="oadrCreatePartyRegistration" type="oadr:oadrCreatePartyRegistrationType">
+		<xs:annotation>
+			<xs:documentation>Used by VEN to initiate registration with VTN</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCreatePartyRegistrationType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+			<xs:element ref="ei:registrationID" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Used for re-registering an existing registration</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:venID" minOccurs="0"/>
+			<xs:element ref="oadr:oadrProfileName"/>
+			<xs:element ref="oadr:oadrTransportName"/>
+			<xs:element ref="oadr:oadrTransportAddress" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Address of this VEN. Not required if http pull model</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="oadr:oadrReportOnly">
+				<xs:annotation>
+					<xs:documentation>ReportOnlyDeviceFlag - True or False</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="oadr:oadrXmlSignature">
+				<xs:annotation>
+					<xs:documentation>Implementation supports XML signatures - True or False</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="oadr:oadrVenName" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Human readable name for VEN</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="oadr:oadrHttpPullModel" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>If transport is simpleHttp indicate if VEN is operating in pull exchange model - true or false</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrCreatedPartyRegistration ******** -->
+	<xs:element name="oadrCreatedPartyRegistration" type="oadr:oadrCreatedPartyRegistrationType">
+		<xs:annotation>
+			<xs:documentation>Acknowledge receipt of VEN registration, provide VTN registration info</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrCreatedPartyRegistrationType">
+		<xs:sequence>
+			<xs:element ref="ei:eiResponse"/>
+			<xs:element ref="ei:registrationID" minOccurs="0"/>
+			<xs:element ref="ei:venID" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>venID not included in query unless already registered</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:vtnID"/>
+			<xs:element ref="oadr:oadrProfiles">
+				<xs:annotation>
+					<xs:documentation>VTN response to query registration returns all supported. This element is not required for a registration  response</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="oadr:oadrRequestedOadrPollFreq" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>HTTP Pull Only - The VEN shall send an oadrPoll payload to the VTN at most once for each duration specified by this element</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="oadr:oadrServiceSpecificInfo" minOccurs="0"/>
+			<xs:element name="oadrExtensions" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="oadrExtension" minOccurs="0" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="oadrExtensionName" type="xs:string"/>
+									<xs:element ref="oadr:oadrInfo" minOccurs="0" maxOccurs="unbounded"/>
+								</xs:sequence>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrRequestReregistration ******** -->
+	<xs:element name="oadrRequestReregistration" type="oadr:oadrRequestReregistrationType">
+		<xs:annotation>
+			<xs:documentation>Used by VTN to request that the VEN reregister</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrRequestReregistrationType">
+		<xs:sequence>
+			<xs:element ref="ei:venID"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!--  ******* oadrQueryRegistration ******** -->
+	<xs:element name="oadrQueryRegistration" type="oadr:oadrQueryRegistrationType">
+		<xs:annotation>
+			<xs:documentation>Query VTN for registration information without actually registering</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrQueryRegistrationType">
+		<xs:sequence>
+			<xs:element ref="pyld:requestID"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!-- ##### POLL PAYLOADS ##### -->
+	<!--  ******* oadrPoll ******** -->
+	<xs:element name="oadrPoll" type="oadr:oadrPollType">
+		<xs:annotation>
+			<xs:documentation>Query pull VTN for payloads with new or modified information</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrPollType">
+		<xs:sequence>
+			<xs:element ref="ei:venID"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!-- ##### END OF PAYLOADS ##### -->
+	<!--  ****** Registration Payload Sub Elements ******** -->
+	<!--  ** oadrVenName ** -->
+	<xs:element name="oadrVenName" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>VEN name. May be used in VTN GUI</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ** oadrProfiles ** -->
+	<xs:element name="oadrProfiles">
+		<xs:annotation>
+			<xs:documentation>OpenADR profiles supported by the implementation</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="oadrProfile" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element ref="oadr:oadrProfileName"/>
+							<xs:element ref="oadr:oadrTransports"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="oadrProfileName" type="oadr:oadrProfileType">
+		<xs:annotation>
+			<xs:documentation>OpenADR profile name such as 2.0a or 2.0b.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:simpleType name="oadrProfileType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="2.0a"/>
+			<xs:enumeration value="2.0b"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!--  ** oadrTransports ** -->
+	<xs:element name="oadrTransports">
+		<xs:annotation>
+			<xs:documentation>OpenADR transports supported by implementation</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="oadrTransport" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element ref="oadr:oadrTransportName"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="oadrTransportName" type="oadr:oadrTransportType">
+		<xs:annotation>
+			<xs:documentation>OpenADR transport name such as simpleHttp or xmpp</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:simpleType name="oadrTransportType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="simpleHttp"/>
+			<xs:enumeration value="xmpp"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:element name="oadrHttpPullModel" type="xs:boolean"/>
+	<!--  ** oadrServiceSpecifictInfo ** -->
+	<xs:element name="oadrServiceSpecificInfo">
+		<xs:annotation>
+			<xs:documentation>Service specific registration information</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="oadrService" minOccurs="0" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element ref="oadr:oadrServiceName"/>
+							<xs:element ref="oadr:oadrInfo" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<!--  ** oadrServiceName ** -->
+	<xs:element name="oadrServiceName" type="oadr:oadrServiceNameType"/>
+	<xs:simpleType name="oadrServiceNameType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="EiEvent"/>
+			<xs:enumeration value="EiOpt"/>
+			<xs:enumeration value="EiReport"/>
+			<xs:enumeration value="EiRegisterParty"/>
+			<xs:enumeration value="OadrPoll"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!--  ** oadrInfo ** -->
+	<xs:element name="oadrInfo">
+		<xs:annotation>
+			<xs:documentation>A key value pair of service specific registration information</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="oadrKey" type="xs:string"/>
+				<xs:element name="oadrValue" type="xs:string"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<!--  ** oadrXmlSignature ** -->
+	<xs:element name="oadrXmlSignature" type="xs:boolean">
+		<xs:annotation>
+			<xs:documentation>Implementation supports XML signature</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ** oadrReportOnly ** -->
+	<xs:element name="oadrReportOnly" type="xs:boolean">
+		<xs:annotation>
+			<xs:documentation>ReportOnlyDeviceFlag</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ** oadrTransportAddress ** -->
+	<xs:element name="oadrTransportAddress" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>Root address used to communicate with other party. Should include port if required</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ** oadrRequestedOadrPollFreq ** -->
+	<xs:element name="oadrRequestedOadrPollFreq" type="xcal:DurationPropType">
+		<xs:annotation>
+			<xs:documentation>The VEN shall send an oadrPoll payload to the VTN at most once for each duration specified by this element</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* ResponseRequired ******** -->
+	<xs:element name="oadrResponseRequired" type="oadr:ResponseRequiredType">
+		<xs:annotation>
+			<xs:documentation>Controls when optIn/optOut repsonse is required. Can be always or never</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:simpleType name="ResponseRequiredType">
+		<xs:annotation>
+			<xs:documentation>Defines what type of response is required</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="always">
+				<xs:annotation>
+					<xs:documentation>Always send a response for every event received.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="never">
+				<xs:annotation>
+					<xs:documentation>Never respond.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+	<!--  ****** Report Payload Sub Elements ******** -->
+	<xs:element name="oadrPendingReports" type="oadr:oadrPendingReportsType"/>
+	<xs:complexType name="oadrPendingReportsType">
+		<xs:sequence>
+			<xs:element ref="ei:reportRequestID" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!--  ****** Additional Units ******** -->
+	<!-- base unit; can be extended and used for custom reports-->
+	<xs:element name="customUnit" type="oadr:BaseUnitType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="BaseUnitType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Custom Units</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string"/>
+					<xs:element name="itemUnits" type="xs:string"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- current -->
+	<xs:element name="current" type="oadr:CurrentType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="CurrentType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Current</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="Current"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="A"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- currency -->
+	<xs:element name="currency" type="oadr:currencyType" substitutionGroup="emix:itemBase"/>
+	<xs:element name="currencyPerKWh" type="oadr:currencyType" substitutionGroup="emix:itemBase"/>
+	<xs:element name="currencyPerKW" type="oadr:currencyType" substitutionGroup="emix:itemBase"/>
+	<xs:element name="currencyPerThm" type="oadr:currencyType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="currencyType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>currency</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="oadr:currencyItemDescriptionType"/>
+					<xs:element name="itemUnits" type="clm5ISO42173A:ISO3AlphaCurrencyCodeContentType">
+						<xs:annotation>
+							<xs:documentation>ISO enumeration of currency types, such as USD</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:simpleType name="currencyItemDescriptionType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="currency"/>
+			<xs:enumeration value="currencyPerKW"/>
+			<xs:enumeration value="currencyPerKWh"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!--  Frequency  units -->
+	<xs:element name="frequency" type="oadr:FrequencyType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="FrequencyType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Frequency</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="Frequency"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="Hz"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!--  Therm  units -->
+	<xs:element name="Therm" type="oadr:ThermType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="ThermType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Therm</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="Therm"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="thm"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- temperature -->
+	<xs:element name="temperature" type="oadr:temperatureType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="temperatureType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>temperature</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="temperature"/>
+					<xs:element name="itemUnits" type="oadr:temperatureUnitType">
+						<xs:annotation>
+							<xs:documentation>Temperature in Celsius or Fahrenheit</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:simpleType name="temperatureUnitType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="celsius"/>
+			<xs:enumeration value="fahrenheit"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- pulseCount -->
+	<xs:element name="pulseCount" type="oadr:pulseCountType" substitutionGroup="emix:itemBase"/>
+	<xs:element name="pulseFactor" type="xs:float">
+		<xs:annotation>
+			<xs:documentation>kWh per count</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="pulseCountType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Pulse Count</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="pulse count"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="count">
+						<xs:annotation>
+							<xs:documentation>Pulse count from meter</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="oadr:pulseFactor"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- Report Request -->
+	<xs:element name="oadrReportRequest" type="oadr:oadrReportRequestType"/>
+	<xs:complexType name="oadrReportRequestType">
+		<xs:annotation>
+			<xs:documentation>This type is used to request an EiReport</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="ei:reportRequestID"/>
+			<xs:element ref="ei:reportSpecifier"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- eiReport -->
+	<xs:element name="oadrReport" type="oadr:oadrReportType"/>
+	<xs:complexType name="oadrReportType">
+		<xs:annotation>
+			<xs:documentation>eiReport is a Stream of [measurements] recorded over time and delivered to the requestor periodically. The readings may be actual, computed, summed if derived in some other manner.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="strm:StreamBaseType">
+				<xs:sequence>
+					<xs:element ref="ei:eiReportID" minOccurs="0">
+						<xs:annotation>
+							<xs:documentation>reference ID to this report.</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="oadr:oadrReportDescription" minOccurs="0" maxOccurs="unbounded">
+						<xs:annotation>
+							<xs:documentation>Define data points the implementation is capable of reporting on. Only used in Metadata report</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="ei:reportRequestID">
+						<xs:annotation>
+							<xs:documentation>Reference to the oadrCreateReport request that defined this report.</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="ei:reportSpecifierID">
+						<xs:annotation>
+							<xs:documentation>Reference to Metadata report from which this report was derived.</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="ei:reportName" minOccurs="0">
+						<xs:annotation>
+							<xs:documentation>Name possibly for use in a user interface.</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="ei:createdDateTime"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- Report Description Type -->
+	<xs:element name="oadrReportDescription" type="oadr:oadrReportDescriptionType"/>
+	<xs:complexType name="oadrReportDescriptionType">
+		<xs:annotation>
+			<xs:documentation>Describes the subject and attributes of a report.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="ei:rID"/>
+			<xs:element ref="ei:reportSubject" minOccurs="0"/>
+			<xs:element ref="ei:reportDataSource" minOccurs="0"/>
+			<xs:element ref="ei:reportType"/>
+			<xs:element ref="emix:itemBase" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>What is measured or tracked in this report (Units). </xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:readingType"/>
+			<xs:element ref="emix:marketContext" minOccurs="0"/>
+			<xs:element ref="oadr:oadrSamplingRate" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="oadrSamplingRateType">
+		<xs:sequence>
+			<xs:element name="oadrMinPeriod" type="xcal:DurationValueType">
+				<xs:annotation>
+					<xs:documentation>Minimum sampling period</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="oadrMaxPeriod" type="xcal:DurationValueType">
+				<xs:annotation>
+					<xs:documentation>Maximum sampling period</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="oadrOnChange" type="xs:boolean">
+				<xs:annotation>
+					<xs:documentation>If true then the data will be recorded when it changes, but at no greater a frequency than that specified  by minPeriod.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:element name="oadrSamplingRate" type="oadr:oadrSamplingRateType">
+		<xs:annotation>
+			<xs:documentation>Sampling rate for telemetry type data</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="oadrPayloadResourceStatus" type="oadr:oadrPayloadResourceStatusType" substitutionGroup="ei:payloadBase">
+		<xs:annotation>
+			<xs:documentation>Current resource status information</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrPayloadResourceStatusType">
+		<xs:annotation>
+			<xs:documentation>This is the payload for reports that require a status.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="ei:PayloadBaseType">
+				<xs:sequence>
+					<xs:element name="oadrOnline" type="xs:boolean">
+						<xs:annotation>
+							<xs:documentation>If true then resource/asset is online, if false then offline.</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element name="oadrManualOverride" type="xs:boolean">
+						<xs:annotation>
+							<xs:documentation>If true then the control of the load has been manually overridden</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="oadr:oadrLoadControlState" minOccurs="0"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:element name="oadrLoadControlState" type="oadr:oadrLoadControlStateType"/>
+	<xs:complexType name="oadrLoadControlStateType">
+		<xs:sequence>
+			<xs:element name="oadrCapacity" type="oadr:oadrLoadControlStateTypeType" minOccurs="0"/>
+			<xs:element name="oadrLevelOffset" type="oadr:oadrLoadControlStateTypeType" minOccurs="0"/>
+			<xs:element name="oadrPercentOffset" type="oadr:oadrLoadControlStateTypeType" minOccurs="0"/>
+			<xs:element name="oadrSetPoint" type="oadr:oadrLoadControlStateTypeType" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="oadrLoadControlStateTypeType">
+		<xs:sequence>
+			<xs:element name="oadrMin" type="xs:float" minOccurs="0"/>
+			<xs:element name="oadrMax" type="xs:float" minOccurs="0"/>
+			<xs:element name="oadrCurrent" type="xs:float"/>
+			<xs:element name="oadrNormal" type="xs:float" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!--Green Button OpenADR Adaptor Types-->
+	<xs:complexType name="oadrGBItemBase">
+		<xs:complexContent>
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element ref="atom:feed"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="oadrGBStreamPayloadBase">
+		<xs:complexContent>
+			<xs:extension base="strm:StreamPayloadBaseType">
+				<xs:sequence>
+					<xs:element ref="atom:feed"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:element name="oadrGBPayload" type="oadr:oadrGBStreamPayloadBase" substitutionGroup="strm:streamPayloadBase"/>
+	<xs:element name="oadrGBDataDescription" type="oadr:oadrGBItemBase" substitutionGroup="emix:itemBase"/>
+	<!--oadrDeviceClass-->
+	<xs:element name="oadrDeviceClass" type="ei:EiTargetType">
+		<xs:annotation>
+			<xs:documentation>Device Class target - use only endDeviceAsset.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--oadrReportPayload-->
+	<xs:element name="oadrReportPayload" type="oadr:oadrReportPayloadType" substitutionGroup="strm:streamPayloadBase">
+		<xs:annotation>
+			<xs:documentation>Data point values for reports</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="oadrReportPayloadType">
+		<xs:annotation>
+			<xs:documentation>Report payload for use in reports.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="ei:ReportPayloadType">
+				<xs:sequence>
+					<xs:element ref="oadr:oadrDataQuality" minOccurs="0">
+						<xs:annotation>
+							<xs:documentation>Enumerated value for the quality of this data item</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!--oadrDataQuality-->
+	<xs:element name="oadrDataQuality" type="oadr:oadrDataQualityTypeType"/>
+	<xs:simpleType name="oadrDataQualityTypeType">
+		<xs:union memberTypes="oadr:oadrDataQualityType ei:EiExtensionTokenType"/>
+	</xs:simpleType>
+	<xs:simpleType name="oadrDataQualityType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="No Quality - No Value"/>
+			<xs:enumeration value="No New Value - Previous Value Used"/>
+			<xs:enumeration value="Quality Bad - Non Specific"/>
+			<xs:enumeration value="Quality Bad - Configuration Error"/>
+			<xs:enumeration value="Quality Bad - Not Connected"/>
+			<xs:enumeration value="Quality Bad - Device Failure"/>
+			<xs:enumeration value="Quality Bad - Sensor Failure"/>
+			<xs:enumeration value="Quality Bad - Last Known Value"/>
+			<xs:enumeration value="Quality Bad - Comm Failure"/>
+			<xs:enumeration value="Quality Bad - Out of Service"/>
+			<xs:enumeration value="Quality Uncertain - Non Specific"/>
+			<xs:enumeration value="Quality Uncertain - Last Usable Value"/>
+			<xs:enumeration value="Quality Uncertain - Sensor Not Accurate"/>
+			<xs:enumeration value="Quality Uncertain - EU Units Exceeded"/>
+			<xs:enumeration value="Quality Uncertain - Sub Normal"/>
+			<xs:enumeration value="Quality Good - Non Specific"/>
+			<xs:enumeration value="Quality Good - Local Override"/>
+			<xs:enumeration value="Quality Limit - Field/Not"/>
+			<xs:enumeration value="Quality Limit - Field/Low"/>
+			<xs:enumeration value="Quality Limit - Field/High"/>
+			<xs:enumeration value="Quality Limit - Field/Constant"/>
+		</xs:restriction>
+	</xs:simpleType>
+</xs:schema>

+ 223 - 0
schema/oadr_ISO_ISO3AlphaCurrencyCode_20100407.xsd

@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ====================================================================== -->
+<!-- ===== 5ISO 4217 3A - Code List Schema Module                     ===== -->
+<!-- ====================================================================== -->
+<!--
+Schema agency:    UN/CEFACT
+Schema version:    7.0
+Schema date:        31 August 2010
+
+Code list name:     ISO 3 alpha currency code
+Code list agency:  ISO
+Code list version:  2010-04-07
+
+Copyright (C) UN/CEFACT (2010). All Rights Reserved.
+
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to UN/CEFACT, except as needed for the purpose of developing UN/CEFACT specifications, in which case the procedures for copyrights defined in the UN/CEFACT Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
+
+The limited permissions granted above are perpetual and will not be revoked by UN/CEFACT or its successors or assigns.
+
+This document and the information contained herein is provided on an "AS IS" basis and UN/CEFACT DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:clm5ISO42173A="urn:un:unece:uncefact:codelist:standard:5:ISO42173A:2010-04-07" xmlns:ccts="urn:un:unece:uncefact:documentation:standard:CoreComponentsTechnicalSpecification:2" targetNamespace="urn:un:unece:uncefact:codelist:standard:5:ISO42173A:2010-04-07" elementFormDefault="qualified" attributeFormDefault="unqualified" version="7.0">
+	<!-- ======================================================================= -->
+	<!-- ===== Element Declarations                                        ===== -->
+	<!-- ======================================================================= -->
+	<!-- ===== Root Element                                                ===== -->
+	<!-- ======================================================================= -->
+	<xsd:element name="ISO3AlphaCurrencyCode" type="clm5ISO42173A:ISO3AlphaCurrencyCodeContentType"/>
+	<!-- ================================================================== -->
+	<!-- ===== Type Definitions                                       ===== -->
+	<!-- ================================================================== -->
+	<!-- ===== Type Definition: ISO 3 alpha currency code Content Type ===== -->
+	<!-- ================================================================== -->
+	<xsd:simpleType name="ISO3AlphaCurrencyCodeContentType">
+		<xsd:restriction base="xsd:token">
+			<xsd:enumeration value="AED"><xsd:annotation><xsd:documentation><ccts:Name>UAE Dirham</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="AFN"><xsd:annotation><xsd:documentation><ccts:Name>Afghani</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ALL"><xsd:annotation><xsd:documentation><ccts:Name>Lek</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="AMD"><xsd:annotation><xsd:documentation><ccts:Name>Armenian Dram</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ANG"><xsd:annotation><xsd:documentation><ccts:Name>Netherlands Antillian Guilder</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="AOA"><xsd:annotation><xsd:documentation><ccts:Name>Kwanza</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ARS"><xsd:annotation><xsd:documentation><ccts:Name>Argentine Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="AUD"><xsd:annotation><xsd:documentation><ccts:Name>Australian Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="AWG"><xsd:annotation><xsd:documentation><ccts:Name>Aruban Guilder</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="AZN"><xsd:annotation><xsd:documentation><ccts:Name>Azerbaijanian Manat</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BAM"><xsd:annotation><xsd:documentation><ccts:Name>Convertible Marks</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BBD"><xsd:annotation><xsd:documentation><ccts:Name>Barbados Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BDT"><xsd:annotation><xsd:documentation><ccts:Name>Taka</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BGN"><xsd:annotation><xsd:documentation><ccts:Name>Bulgarian Lev</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BHD"><xsd:annotation><xsd:documentation><ccts:Name>Bahraini Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BIF"><xsd:annotation><xsd:documentation><ccts:Name>Burundi Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BMD"><xsd:annotation><xsd:documentation><ccts:Name>Bermudian Dollar (customarily known as Bermuda Dollar)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BND"><xsd:annotation><xsd:documentation><ccts:Name>Brunei Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BOB"><xsd:annotation><xsd:documentation><ccts:Name>Boliviano</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BOV"><xsd:annotation><xsd:documentation><ccts:Name>Mvdol</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BRL"><xsd:annotation><xsd:documentation><ccts:Name>Brazilian Real</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BSD"><xsd:annotation><xsd:documentation><ccts:Name>Bahamian Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BTN"><xsd:annotation><xsd:documentation><ccts:Name>Ngultrum</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BWP"><xsd:annotation><xsd:documentation><ccts:Name>Pula</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BYR"><xsd:annotation><xsd:documentation><ccts:Name>Belarussian Ruble</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="BZD"><xsd:annotation><xsd:documentation><ccts:Name>Belize Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CAD"><xsd:annotation><xsd:documentation><ccts:Name>Canadian Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CDF"><xsd:annotation><xsd:documentation><ccts:Name>Congolese Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CHE"><xsd:annotation><xsd:documentation><ccts:Name>WIR Euro</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CHF"><xsd:annotation><xsd:documentation><ccts:Name>Swiss Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CHW"><xsd:annotation><xsd:documentation><ccts:Name>WIR Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CLF"><xsd:annotation><xsd:documentation><ccts:Name>Unidades de fomento</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CLP"><xsd:annotation><xsd:documentation><ccts:Name>Chilean Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CNY"><xsd:annotation><xsd:documentation><ccts:Name>Yuan Renminbi</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="COP"><xsd:annotation><xsd:documentation><ccts:Name>Colombian Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="COU"><xsd:annotation><xsd:documentation><ccts:Name>Unidad de Valor Real</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CRC"><xsd:annotation><xsd:documentation><ccts:Name>Costa Rican Colon</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CUC"><xsd:annotation><xsd:documentation><ccts:Name>Peso Convertible</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CUP"><xsd:annotation><xsd:documentation><ccts:Name>Cuban Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CVE"><xsd:annotation><xsd:documentation><ccts:Name>Cape Verde Escudo</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="CZK"><xsd:annotation><xsd:documentation><ccts:Name>Czech Koruna</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="DJF"><xsd:annotation><xsd:documentation><ccts:Name>Djibouti Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="DKK"><xsd:annotation><xsd:documentation><ccts:Name>Danish Krone</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="DOP"><xsd:annotation><xsd:documentation><ccts:Name>Dominican Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="DZD"><xsd:annotation><xsd:documentation><ccts:Name>Algerian Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="EEK"><xsd:annotation><xsd:documentation><ccts:Name>Kroon</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="EGP"><xsd:annotation><xsd:documentation><ccts:Name>Egyptian Pound</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ERN"><xsd:annotation><xsd:documentation><ccts:Name>Nakfa</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ETB"><xsd:annotation><xsd:documentation><ccts:Name>Ethiopian Birr</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="EUR"><xsd:annotation><xsd:documentation><ccts:Name>Euro</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="FJD"><xsd:annotation><xsd:documentation><ccts:Name>Fiji Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="FKP"><xsd:annotation><xsd:documentation><ccts:Name>Falkland Islands Pound</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GBP"><xsd:annotation><xsd:documentation><ccts:Name>Pound Sterling</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GEL"><xsd:annotation><xsd:documentation><ccts:Name>Lari</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GHS"><xsd:annotation><xsd:documentation><ccts:Name>Cedi</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GIP"><xsd:annotation><xsd:documentation><ccts:Name>Gibraltar Pound</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GMD"><xsd:annotation><xsd:documentation><ccts:Name>Dalasi</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GNF"><xsd:annotation><xsd:documentation><ccts:Name>Guinea Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GTQ"><xsd:annotation><xsd:documentation><ccts:Name>Quetzal</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GWP"><xsd:annotation><xsd:documentation><ccts:Name>Guinea-Bissau Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="GYD"><xsd:annotation><xsd:documentation><ccts:Name>Guyana Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="HKD"><xsd:annotation><xsd:documentation><ccts:Name>Hong Kong Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="HNL"><xsd:annotation><xsd:documentation><ccts:Name>Lempira</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="HRK"><xsd:annotation><xsd:documentation><ccts:Name>Croatian Kuna</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="HTG"><xsd:annotation><xsd:documentation><ccts:Name>Gourde</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="HUF"><xsd:annotation><xsd:documentation><ccts:Name>Forint</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="IDR"><xsd:annotation><xsd:documentation><ccts:Name>Rupiah</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ILS"><xsd:annotation><xsd:documentation><ccts:Name>New Israeli Sheqel</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="INR"><xsd:annotation><xsd:documentation><ccts:Name>Indian Rupee</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="IQD"><xsd:annotation><xsd:documentation><ccts:Name>Iraqi Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="IRR"><xsd:annotation><xsd:documentation><ccts:Name>Iranian Rial</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ISK"><xsd:annotation><xsd:documentation><ccts:Name>Iceland Krona</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="JMD"><xsd:annotation><xsd:documentation><ccts:Name>Jamaican Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="JOD"><xsd:annotation><xsd:documentation><ccts:Name>Jordanian Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="JPY"><xsd:annotation><xsd:documentation><ccts:Name>Yen</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KES"><xsd:annotation><xsd:documentation><ccts:Name>Kenyan Shilling</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KGS"><xsd:annotation><xsd:documentation><ccts:Name>Som</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KHR"><xsd:annotation><xsd:documentation><ccts:Name>Riel</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KMF"><xsd:annotation><xsd:documentation><ccts:Name>Comoro Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KPW"><xsd:annotation><xsd:documentation><ccts:Name>North Korean Won</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KRW"><xsd:annotation><xsd:documentation><ccts:Name>Won</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KWD"><xsd:annotation><xsd:documentation><ccts:Name>Kuwaiti Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KYD"><xsd:annotation><xsd:documentation><ccts:Name>Cayman Islands Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="KZT"><xsd:annotation><xsd:documentation><ccts:Name>Tenge</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LAK"><xsd:annotation><xsd:documentation><ccts:Name>Kip</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LBP"><xsd:annotation><xsd:documentation><ccts:Name>Lebanese Pound</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LKR"><xsd:annotation><xsd:documentation><ccts:Name>Sri Lanka Rupee</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LRD"><xsd:annotation><xsd:documentation><ccts:Name>Liberian Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LSL"><xsd:annotation><xsd:documentation><ccts:Name>Loti</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LTL"><xsd:annotation><xsd:documentation><ccts:Name>Lithuanian Litas</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LVL"><xsd:annotation><xsd:documentation><ccts:Name>Latvian Lats</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="LYD"><xsd:annotation><xsd:documentation><ccts:Name>Libyan Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MAD"><xsd:annotation><xsd:documentation><ccts:Name>Moroccan Dirham</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MAD"><xsd:annotation><xsd:documentation><ccts:Name>Moroccan Dirham</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MDL"><xsd:annotation><xsd:documentation><ccts:Name>Moldovan Leu</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MGA"><xsd:annotation><xsd:documentation><ccts:Name>Malagasy Ariary</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MKD"><xsd:annotation><xsd:documentation><ccts:Name>Denar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MMK"><xsd:annotation><xsd:documentation><ccts:Name>Kyat</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MNT"><xsd:annotation><xsd:documentation><ccts:Name>Tugrik</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MOP"><xsd:annotation><xsd:documentation><ccts:Name>Pataca</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MRO"><xsd:annotation><xsd:documentation><ccts:Name>Ouguiya</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MUR"><xsd:annotation><xsd:documentation><ccts:Name>Mauritius Rupee</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MVR"><xsd:annotation><xsd:documentation><ccts:Name>Rufiyaa</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MWK"><xsd:annotation><xsd:documentation><ccts:Name>Kwacha</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MXN"><xsd:annotation><xsd:documentation><ccts:Name>Mexican Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MXV"><xsd:annotation><xsd:documentation><ccts:Name>Mexican Unidad de Inversion (UDI)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MYR"><xsd:annotation><xsd:documentation><ccts:Name>Malaysian Ringgit</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="MZN"><xsd:annotation><xsd:documentation><ccts:Name>Metical</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="NAD"><xsd:annotation><xsd:documentation><ccts:Name>Namibia Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="NGN"><xsd:annotation><xsd:documentation><ccts:Name>Naira</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="NIO"><xsd:annotation><xsd:documentation><ccts:Name>Cordoba Oro</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="NOK"><xsd:annotation><xsd:documentation><ccts:Name>Norwegian Krone</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="NPR"><xsd:annotation><xsd:documentation><ccts:Name>Nepalese Rupee</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="NZD"><xsd:annotation><xsd:documentation><ccts:Name>New Zealand Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="OMR"><xsd:annotation><xsd:documentation><ccts:Name>Rial Omani</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="PAB"><xsd:annotation><xsd:documentation><ccts:Name>Balboa</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="PEN"><xsd:annotation><xsd:documentation><ccts:Name>Nuevo Sol</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="PGK"><xsd:annotation><xsd:documentation><ccts:Name>Kina</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="PHP"><xsd:annotation><xsd:documentation><ccts:Name>Philippine Peso</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="PKR"><xsd:annotation><xsd:documentation><ccts:Name>Pakistan Rupee</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="PLN"><xsd:annotation><xsd:documentation><ccts:Name>Zloty</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="PYG"><xsd:annotation><xsd:documentation><ccts:Name>Guarani</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="QAR"><xsd:annotation><xsd:documentation><ccts:Name>Qatari Rial</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="RON"><xsd:annotation><xsd:documentation><ccts:Name>New Leu</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="RSD"><xsd:annotation><xsd:documentation><ccts:Name>Serbian Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="RUB"><xsd:annotation><xsd:documentation><ccts:Name>Russian Ruble</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="RWF"><xsd:annotation><xsd:documentation><ccts:Name>Rwanda Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SAR"><xsd:annotation><xsd:documentation><ccts:Name>Saudi Riyal</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SBD"><xsd:annotation><xsd:documentation><ccts:Name>Solomon Islands Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SCR"><xsd:annotation><xsd:documentation><ccts:Name>Seychelles Rupee</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SDG"><xsd:annotation><xsd:documentation><ccts:Name>Sudanese Pound</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SEK"><xsd:annotation><xsd:documentation><ccts:Name>Swedish Krona</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SGD"><xsd:annotation><xsd:documentation><ccts:Name>Singapore Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SHP"><xsd:annotation><xsd:documentation><ccts:Name>Saint Helena Pound</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SLL"><xsd:annotation><xsd:documentation><ccts:Name>Leone</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SOS"><xsd:annotation><xsd:documentation><ccts:Name>Somali Shilling</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SRD"><xsd:annotation><xsd:documentation><ccts:Name>Surinam Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="STD"><xsd:annotation><xsd:documentation><ccts:Name>Dobra</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SVC"><xsd:annotation><xsd:documentation><ccts:Name>El Salvador Colon</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SYP"><xsd:annotation><xsd:documentation><ccts:Name>Syrian Pound</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="SZL"><xsd:annotation><xsd:documentation><ccts:Name>Lilangeni</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="THB"><xsd:annotation><xsd:documentation><ccts:Name>Baht</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TJS"><xsd:annotation><xsd:documentation><ccts:Name>Somoni</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TMT"><xsd:annotation><xsd:documentation><ccts:Name>Manat</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TND"><xsd:annotation><xsd:documentation><ccts:Name>Tunisian Dinar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TOP"><xsd:annotation><xsd:documentation><ccts:Name>Pa'anga</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TRY"><xsd:annotation><xsd:documentation><ccts:Name>Turkish Lira</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TTD"><xsd:annotation><xsd:documentation><ccts:Name>Trinidad and Tobago Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TWD"><xsd:annotation><xsd:documentation><ccts:Name>New Taiwan Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="TZS"><xsd:annotation><xsd:documentation><ccts:Name>Tanzanian Shilling</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="UAH"><xsd:annotation><xsd:documentation><ccts:Name>Hryvnia</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="UGX"><xsd:annotation><xsd:documentation><ccts:Name>Uganda Shilling</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="USD"><xsd:annotation><xsd:documentation><ccts:Name>US Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="USN"><xsd:annotation><xsd:documentation><ccts:Name>US Dollar (Next day)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="USS"><xsd:annotation><xsd:documentation><ccts:Name>US Dollar (Same day)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="UYI"><xsd:annotation><xsd:documentation><ccts:Name>Uruguay Peso en Unidades Indexadas</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="UYU"><xsd:annotation><xsd:documentation><ccts:Name>Peso Uruguayo</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="UZS"><xsd:annotation><xsd:documentation><ccts:Name>Uzbekistan Sum</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="VEF"><xsd:annotation><xsd:documentation><ccts:Name>Bolivar Fuerte</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="VND"><xsd:annotation><xsd:documentation><ccts:Name>Dong</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="VUV"><xsd:annotation><xsd:documentation><ccts:Name>Vatu</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="WST"><xsd:annotation><xsd:documentation><ccts:Name>Tala</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XAF"><xsd:annotation><xsd:documentation><ccts:Name>CFA Franc BEAC</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XAG"><xsd:annotation><xsd:documentation><ccts:Name>Silver</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XAU"><xsd:annotation><xsd:documentation><ccts:Name>Gold</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XBA"><xsd:annotation><xsd:documentation><ccts:Name>Bond Markets Units European Composite Unit (EURCO)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XBB"><xsd:annotation><xsd:documentation><ccts:Name>European Monetary Unit (E.M.U.-6)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XBC"><xsd:annotation><xsd:documentation><ccts:Name>European Unit of Account 9(E.U.A.-9)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XBD"><xsd:annotation><xsd:documentation><ccts:Name>European Unit of Account 17(E.U.A.-17)</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XCD"><xsd:annotation><xsd:documentation><ccts:Name>East Caribbean Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XDR"><xsd:annotation><xsd:documentation><ccts:Name>SDR</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XFU"><xsd:annotation><xsd:documentation><ccts:Name>UIC-Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XOF"><xsd:annotation><xsd:documentation><ccts:Name>CFA Franc BCEAO †</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XPD"><xsd:annotation><xsd:documentation><ccts:Name>Palladium</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XPF"><xsd:annotation><xsd:documentation><ccts:Name>CFP Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XPF"><xsd:annotation><xsd:documentation><ccts:Name>CFP Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XPF"><xsd:annotation><xsd:documentation><ccts:Name>CFP Franc</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XPT"><xsd:annotation><xsd:documentation><ccts:Name>Platinum</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XTS"><xsd:annotation><xsd:documentation><ccts:Name>Codes specifically reserved for testing purposes</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="XXX"><xsd:annotation><xsd:documentation><ccts:Name>The codes assigned for transactions where no currency is involved are:</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="YER"><xsd:annotation><xsd:documentation><ccts:Name>Yemeni Rial</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ZAR"><xsd:annotation><xsd:documentation><ccts:Name>Rand</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ZMK"><xsd:annotation><xsd:documentation><ccts:Name>Zambian Kwacha</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+<xsd:enumeration value="ZWL"><xsd:annotation><xsd:documentation><ccts:Name>Zimbabwe Dollar</ccts:Name></xsd:documentation></xsd:annotation></xsd:enumeration>
+
+		</xsd:restriction>
+	</xsd:simpleType>
+</xsd:schema>

+ 238 - 0
schema/oadr_atom.xsd

@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="http://www.w3.org/2005/Atom" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:annotation>
+		<xs:documentation>
+				This version of the Atom schema is based on version 1.0 of the format specifications,
+				found here http://www.atomenabled.org/developers/syndication/atom-format-spec.php.
+			</xs:documentation>
+	</xs:annotation>
+	<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="oadr_xml.xsd"/>
+	<xs:annotation>
+		<xs:documentation>
+			An Atom document may have two root elements, feed and entry, as defined in section 2. 
+		</xs:documentation>
+	</xs:annotation>
+	<xs:element name="feed" type="atom:feedType"/>
+	<xs:element name="entry" type="atom:entryType"/>
+	<xs:complexType name="textType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom text construct is defined in section 3.1 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:any namespace="http://www.w3.org/1999/xhtml" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="type">
+			<xs:simpleType>
+				<xs:restriction base="xs:token">
+					<xs:enumeration value="text"/>
+					<xs:enumeration value="html"/>
+					<xs:enumeration value="xhtml"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:complexType name="personType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom person construct is defined in section 3.2 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="name" type="xs:string"/>
+			<xs:element name="uri" type="atom:uriType" minOccurs="0"/>
+			<xs:element name="email" type="atom:emailType" minOccurs="0"/>
+			<xs:any namespace="##other"/>
+		</xs:choice>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:simpleType name="emailType">
+		<xs:annotation>
+			<xs:documentation>
+				Schema definition for an email address.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:normalizedString">
+			<xs:pattern value="\w+@(\w+\.)+\w+"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:complexType name="feedType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom feed construct is defined in section 4.1.1 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="3" maxOccurs="unbounded">
+			<xs:element name="author" type="atom:personType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="category" type="atom:categoryType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="contributor" type="atom:personType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="generator" type="atom:generatorType" minOccurs="0"/>
+			<xs:element name="icon" type="atom:iconType" minOccurs="0"/>
+			<xs:element name="id" type="atom:idType"/>
+			<xs:element name="link" type="atom:linkType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="logo" type="atom:logoType" minOccurs="0"/>
+			<xs:element name="rights" type="atom:textType" minOccurs="0"/>
+			<xs:element name="subtitle" type="atom:textType" minOccurs="0"/>
+			<xs:element name="title" type="atom:textType"/>
+			<xs:element name="updated" type="atom:dateTimeType"/>
+			<xs:element name="entry" type="atom:entryType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:choice>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:complexType name="entryType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom entry construct is defined in section 4.1.2 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="author" type="atom:personType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="category" type="atom:categoryType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="content" type="atom:contentType" minOccurs="0"/>
+			<xs:element name="contributor" type="atom:personType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="id" type="atom:idType"/>
+			<xs:element name="link" type="atom:linkType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="published" type="atom:dateTimeType" minOccurs="0"/>
+			<xs:element name="rights" type="atom:textType" minOccurs="0"/>
+			<xs:element name="source" type="atom:textType" minOccurs="0"/>
+			<xs:element name="summary" type="atom:textType" minOccurs="0"/>
+			<xs:element name="title" type="atom:textType"/>
+			<xs:element name="updated" type="atom:dateTimeType"/>
+			<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:choice>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:complexType name="contentType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom content construct is defined in section 4.1.3 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="type" type="xs:string"/>
+		<xs:attribute name="src" type="xs:anyURI"/>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:complexType name="categoryType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom category construct is defined in section 4.2.2 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:attribute name="term" type="xs:string" use="required"/>
+		<xs:attribute name="scheme" type="xs:anyURI" use="optional"/>
+		<xs:attribute name="label" type="xs:string" use="optional"/>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:complexType name="generatorType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom generator element is defined in section 4.2.4 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="uri" type="xs:anyURI" use="optional"/>
+				<xs:attribute name="version" type="xs:string" use="optional"/>
+				<xs:attributeGroup ref="atom:commonAttributes"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="iconType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom icon construct is defined in section 4.2.5 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attributeGroup ref="atom:commonAttributes"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="idType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom id construct is defined in section 4.2.6 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attributeGroup ref="atom:commonAttributes"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="linkType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom link construct is defined in section 3.4 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:attribute name="href" type="xs:anyURI" use="required"/>
+		<xs:attribute name="rel" type="xs:string" use="optional"/>
+		<xs:attribute name="type" type="xs:string" use="optional"/>
+		<xs:attribute name="hreflang" type="xs:NMTOKEN" use="optional"/>
+		<xs:attribute name="title" type="xs:string" use="optional"/>
+		<xs:attribute name="length" type="xs:positiveInteger" use="optional"/>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:complexType name="logoType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom logo construct is defined in section 4.2.8 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attributeGroup ref="atom:commonAttributes"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="sourceType">
+		<xs:annotation>
+			<xs:documentation>
+				The Atom source construct is defined in section 4.2.11 of the format spec.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="author" type="atom:personType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="category" type="atom:categoryType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="contributor" type="atom:personType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="generator" type="atom:generatorType" minOccurs="0"/>
+			<xs:element name="icon" type="atom:iconType" minOccurs="0"/>
+			<xs:element name="id" type="atom:idType" minOccurs="0"/>
+			<xs:element name="link" type="atom:linkType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="logo" type="atom:logoType" minOccurs="0"/>
+			<xs:element name="rights" type="atom:textType" minOccurs="0"/>
+			<xs:element name="subtitle" type="atom:textType" minOccurs="0"/>
+			<xs:element name="title" type="atom:textType" minOccurs="0"/>
+			<xs:element name="updated" type="atom:dateTimeType" minOccurs="0"/>
+			<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:choice>
+		<xs:attributeGroup ref="atom:commonAttributes"/>
+	</xs:complexType>
+	<xs:complexType name="uriType">
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attributeGroup ref="atom:commonAttributes"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="dateTimeType">
+		<xs:simpleContent>
+			<xs:extension base="xs:dateTime">
+				<xs:attributeGroup ref="atom:commonAttributes"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:attributeGroup name="commonAttributes">
+		<xs:attribute ref="xml:base"/>
+		<xs:attribute ref="xml:lang"/>
+		<xs:anyAttribute namespace="##other"/>
+	</xs:attributeGroup>
+</xs:schema>

+ 1012 - 0
schema/oadr_ei_20b.xsd

@@ -0,0 +1,1012 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- edited with XMLSpy v2010 rel. 3 (x64) (http://www.altova.com) by James Zuber (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110" xmlns:pyld="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" xmlns:strm="urn:ietf:params:xml:ns:icalendar-2.0:stream" xmlns:power="http://docs.oasis-open.org/ns/emix/2011/06/power" targetNamespace="http://docs.oasis-open.org/ns/energyinterop/201110" elementFormDefault="qualified" attributeFormDefault="qualified">
+	<xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06/power" schemaLocation="oadr_power_20b.xsd"/>
+	<xs:import namespace="urn:ietf:params:xml:ns:icalendar-2.0" schemaLocation="oadr_xcal_20b.xsd"/>
+	<xs:import namespace="urn:ietf:params:xml:ns:icalendar-2.0:stream" schemaLocation="oadr_strm_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06" schemaLocation="oadr_emix_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" schemaLocation="oadr_pyld_20b.xsd"/>
+	<!-- ##### SAME AS A  ##### -->
+	<xs:element name="eventStatus" type="ei:EventStatusEnumeratedType"/>
+	<!--  ******* EventStatusEnumeratedType ******** -->
+	<xs:simpleType name="EventStatusEnumeratedType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="none">
+				<xs:annotation>
+					<xs:documentation>No event pending</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="far">
+				<xs:annotation>
+					<xs:documentation>Event pending in the far future. The exact definition of how far in the future this refers is dependent upon the market context, but typically means the next day.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="near">
+				<xs:annotation>
+					<xs:documentation>Event pending in the near future. The exact definition of how near in the future the pending event is active is dependent on the market context.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="active">
+				<xs:annotation>
+					<xs:documentation>The event has been initiated and is currently active.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="completed">
+				<xs:annotation>
+					<xs:documentation>The event has completed.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="cancelled">
+				<xs:annotation>
+					<xs:documentation>The event has been canceled.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- ******* resourceID ******* -->
+	<xs:element name="resourceID" type="xs:string"/>
+	<!-- ******* groupID *******-->
+	<xs:element name="groupID" type="xs:string"/>
+	<!-- *******  partyID *******  -->
+	<xs:element name="partyID" type="xs:string"/>
+	<!-- ******* groupName *******-->
+	<xs:element name="groupName" type="xs:string"/>
+	<xs:simpleType name="EiExtensionTokenType">
+		<xs:annotation>
+			<xs:documentation>Pattern used for extending string enumeration, where allowed.</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:pattern value="x-\S.*"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!--  ******* venID ******** -->
+	<xs:element name="venID" type="xs:string"/>
+	<!--  ******* vtnID ******** -->
+	<xs:element name="vtnID" type="xs:string"/>
+	<!--  ******* eventID ******** -->
+	<xs:element name="eventID" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>An ID value that identifies a specific DR event instance.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* modificationNumber ******** -->
+	<xs:element name="modificationNumber" type="xs:unsignedInt">
+		<xs:annotation>
+			<xs:documentation>Incremented each time an event is modified.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* qualifiedEventID ******** -->
+	<xs:element name="qualifiedEventID" type="ei:QualifiedEventIDType"/>
+	<!--  ******* QualifiedEventIDType ******** -->
+	<xs:complexType name="QualifiedEventIDType">
+		<xs:annotation>
+			<xs:documentation>Fully qualified event ID includes the eventID and the modificationNumber.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="ei:eventID"/>
+			<xs:element ref="ei:modificationNumber"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!--  ******* x-eiNotification ******** -->
+	<xs:element name="x-eiNotification" type="xcal:DurationPropType">
+		<xs:annotation>
+			<xs:documentation>The VEN should receive the DR event payload prior to dtstart minus this duration.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* x-eiRampUp ******** -->
+	<xs:element name="x-eiRampUp" type="xcal:DurationPropType">
+		<xs:annotation>
+			<xs:documentation>A duration before or after the event start time during which load shed should transit.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  *******x-eiRecovery******** -->
+	<xs:element name="x-eiRecovery" type="xcal:DurationPropType">
+		<xs:annotation>
+			<xs:documentation>A duration before or after the event end time during which load shed should transit.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* interval ******** -->
+	<xs:element name="interval" type="ei:IntervalType"/>
+	<xs:complexType name="IntervalType">
+		<xs:sequence>
+			<xs:element ref="xcal:dtstart" minOccurs="0"/>
+			<xs:element ref="xcal:duration" minOccurs="0"/>
+			<xs:element ref="xcal:uid" minOccurs="0"/>
+			<xs:element ref="strm:streamPayloadBase" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!--  ******* currentValue ******** -->
+	<xs:element name="currentValue" type="ei:currentValueType">
+		<xs:annotation>
+			<xs:documentation>The payloadFloat value of the event interval currently executing.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="currentValueType">
+		<xs:choice>
+			<xs:element ref="ei:payloadFloat"/>
+		</xs:choice>
+	</xs:complexType>
+	<!--  ******* payloadFloat ******** -->
+	<xs:element name="payloadBase" type="ei:PayloadBaseType" abstract="true"/>
+	<xs:complexType name="PayloadBaseType" abstract="true">
+		<xs:annotation>
+			<xs:documentation>Base for information in signal / baseline / report payloads</xs:documentation>
+		</xs:annotation>
+	</xs:complexType>
+	<xs:element name="payloadFloat" type="ei:PayloadFloatType" substitutionGroup="ei:payloadBase">
+		<xs:annotation>
+			<xs:documentation>Data point value for event signals or for reporting  current or historical values.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="PayloadFloatType">
+		<xs:annotation>
+			<xs:documentation>This is the payload for signals that require a quantity.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="ei:PayloadBaseType">
+				<xs:sequence>
+					<xs:element name="value" type="xs:float"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- ########## Message Responses ########## -->
+	<!--  ******* responseCode ******** -->
+	<xs:element name="responseCode" type="ei:ResponseCodeType">
+		<xs:annotation>
+			<xs:documentation>A 3 digit response code</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* responseCodeType ******** -->
+	<xs:simpleType name="ResponseCodeType">
+		<xs:annotation>
+			<xs:documentation>Similar to HTTP 1.1 Error Pattern, 1st digit sufficient for most error processing
+      - 1xx: Informational - Request received, continuing process
+      - 2xx: Success - The action was successfully received, understood, and accepted
+      - 3xx: Pending - Further action must be taken in order to complete the request
+      - 4xx: Requester Error - The request contains bad syntax or cannot be fulfilled
+      - 5xx: Responder Error - The responder failed to fulfill an apparently valid request
+      xx is used for defining more fine grained errors
+	</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:pattern value="[0-9][0-9][0-9]"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!--  ******* responseDescription ******** -->
+	<xs:element name="responseDescription" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>Narrative description of response status</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* optType ******** -->
+	<xs:element name="optType" type="ei:OptTypeType">
+		<xs:annotation>
+			<xs:documentation>optIn or optOut of an event</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:simpleType name="OptTypeType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="optIn"/>
+			<xs:enumeration value="optOut"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!--  ******* eiResponse ******** -->
+	<xs:element name="eiResponse" type="ei:EiResponseType">
+		<xs:annotation>
+			<xs:documentation>Indicate whether received payload is acceptable</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="EiResponseType">
+		<xs:sequence>
+			<xs:element ref="ei:responseCode"/>
+			<xs:element ref="ei:responseDescription" minOccurs="0"/>
+			<xs:element ref="pyld:requestID"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!--  ******* eventResponses ******** -->
+	<xs:element name="eventResponses">
+		<xs:annotation>
+			<xs:documentation>optIn or optOut responses for received events</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="eventResponse" minOccurs="0" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element ref="ei:responseCode"/>
+							<xs:element ref="ei:responseDescription" minOccurs="0"/>
+							<xs:element ref="pyld:requestID"/>
+							<xs:element ref="ei:qualifiedEventID"/>
+							<xs:element ref="ei:optType"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<!--########### eiEvent Section ##########-->
+	<!--  ******* eiEvent ******** -->
+	<xs:element name="eiEvent" type="ei:eiEventType"/>
+	<xs:complexType name="eiEventType">
+		<xs:sequence>
+			<xs:element ref="ei:eventDescriptor"/>
+			<xs:element ref="ei:eiActivePeriod"/>
+			<xs:element ref="ei:eiEventSignals"/>
+			<xs:element ref="ei:eiTarget"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- ***** eiActivePeriod *****-->
+	<xs:element name="eiActivePeriod" type="ei:eiActivePeriodType">
+		<xs:annotation>
+			<xs:documentation>Time frames relevant to the overall event</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="eiActivePeriodType">
+		<xs:sequence>
+			<xs:element ref="xcal:properties"/>
+			<xs:element ref="xcal:components"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!--  ******* signalType ******** -->
+	<xs:element name="signalType" type="ei:SignalTypeEnumeratedType">
+		<xs:annotation>
+			<xs:documentation>An enumerated value describing the type of signal such as level or price</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!--  ******* SignalTypeEnumeratedType ******** -->
+	<xs:simpleType name="SignalTypeEnumeratedType">
+		<xs:annotation>
+			<xs:documentation>SignalTypeEnumerated lists the pre-defined types used to specify the payload types and conformance in a stream</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="delta">
+				<xs:annotation>
+					<xs:documentation>Signal indicates the amount to change from what one would have used without the signal.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="level">
+				<xs:annotation>
+					<xs:documentation>Signal indicates a program level.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="multiplier">
+				<xs:annotation>
+					<xs:documentation>Signal indicates a multiplier applied to the current rate of  delivery or usage from what one would have used without the signal.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="price">
+				<xs:annotation>
+					<xs:documentation>Signal indicates the price.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="priceMultiplier">
+				<xs:annotation>
+					<xs:documentation>Signal indicates the price multiplier. Extended price is the computed price value multiplied by the number of units.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="priceRelative">
+				<xs:annotation>
+					<xs:documentation>Signal indicates the relative price.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="setpoint">
+				<xs:annotation>
+					<xs:documentation>Signal indicates a target amount of units.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="x-loadControlCapacity">
+				<xs:annotation>
+					<xs:documentation>This is an instruction for the load controller to operate at a level that is some percentage of its maximum load consumption capacity. This can be mapped to specific load controllers to do things like duty cycling. Note that 1.0 refers to 100% consumption. In the case of simple ON/OFF type devices then 0 = OFF and 1 = ON.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="x-loadControlLevelOffset">
+				<xs:annotation>
+					<xs:documentation>Discrete integer levels that are relative to normal operations where 0 is normal operations.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="x-loadControlPercentOffset">
+				<xs:annotation>
+					<xs:documentation>Percentage change from normal load control operations.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="x-loadControlSetpoint">
+				<xs:annotation>
+					<xs:documentation>Load controller set points.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- ##### NEW FOR B ##### -->
+	<!-- ***** Array of responses ***** -->
+	<xs:element name="responses" type="ei:ArrayofResponses"/>
+	<xs:complexType name="ArrayofResponses">
+		<xs:annotation>
+			<xs:documentation>Collection of Responses. When a service operation regards multiple referenceable items, each referenced item may have its own response. Always accompanied by an overall Response Type.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="response" type="ei:EiResponseType" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- ***** Extended eventDescriptor ***** -->
+	<xs:element name="eventDescriptor" type="ei:eventDescriptorType">
+		<xs:annotation>
+			<xs:documentation>Information about the event</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="eventDescriptorType">
+		<xs:sequence>
+			<xs:element ref="ei:eventID"/>
+			<xs:element ref="ei:modificationNumber"/>
+			<xs:element name="modificationDateTime" type="xcal:DateTimeType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>When an event is modified</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="modificationReason" type="xs:string" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Why an event was modified</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="priority" type="xs:unsignedInt" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>The priority of the event in relation to other events (The lower the number higher the priority. A value of zero (0) indicates no priority, which is the lowest priority by default).</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="eiMarketContext">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element ref="emix:marketContext"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element ref="ei:createdDateTime"/>
+			<xs:element ref="ei:eventStatus">
+				<xs:annotation>
+					<xs:documentation>An indication of the event state: far, near, active, canceled, completed</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="testEvent" type="xs:string" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Anything other than false indicates a test event</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="vtnComment" type="xs:string" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Any text</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:element name="signalPayload" type="ei:signalPayloadType" substitutionGroup="strm:streamPayloadBase">
+		<xs:annotation>
+			<xs:documentation>Signal values for events and baselines</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="signalPayloadType">
+		<xs:complexContent>
+			<xs:extension base="strm:StreamPayloadBaseType">
+				<xs:choice>
+					<xs:element ref="ei:payloadBase"/>
+				</xs:choice>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!--  ******* createdDateTime ******** -->
+	<xs:element name="createdDateTime" type="xcal:DateTimeType">
+		<xs:annotation>
+			<xs:documentation>The dateTime the payload was created</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!-- ***** Extended eiTarget *****-->
+	<xs:element name="eiTarget" type="ei:EiTargetType">
+		<xs:annotation>
+			<xs:documentation>Identifies the resources associated with the logical VEN interface. For events, the values specified are the target for the event</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="EiTargetType">
+		<xs:sequence>
+			<xs:element ref="power:aggregatedPnode" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="power:endDeviceAsset" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="power:meterAsset" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="power:pnode" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="emix:serviceArea" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="power:serviceDeliveryPoint" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="power:serviceLocation" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="power:transportInterface" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:groupID" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:groupName" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:resourceID" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:venID" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="ei:partyID" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- ***** Extended Event Signal ***** -->
+	<xs:element name="eiEventSignal" type="ei:eiEventSignalType"/>
+	<xs:complexType name="eiEventSignalType">
+		<xs:sequence>
+			<xs:element ref="strm:intervals"/>
+			<xs:element ref="ei:eiTarget" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Optionally identifies the device class associated with the signal. Only the endDeviceAsset subelement is used</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:signalName">
+				<xs:annotation>
+					<xs:documentation>Descriptive name for signal.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:signalType"/>
+			<xs:element name="signalID" type="xs:string">
+				<xs:annotation>
+					<xs:documentation>unique Identifier for a specific event signal</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="emix:itemBase" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>This is the unit of the signal.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:currentValue" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:element name="signalName" type="ei:signalNameType"/>
+	<xs:simpleType name="signalNameType">
+		<xs:annotation>
+			<xs:documentation>Signal name.</xs:documentation>
+		</xs:annotation>
+		<xs:union memberTypes="ei:SignalNameEnumeratedType ei:EiExtensionTokenType"/>
+	</xs:simpleType>
+	<xs:element name="SignalNameEnumerated" type="ei:SignalNameEnumeratedType"/>
+	<xs:simpleType name="SignalNameEnumeratedType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="SIMPLE">
+				<xs:annotation>
+					<xs:documentation>Simple levels (OpenADR 2.0a compliant)</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="simple">
+				<xs:annotation>
+					<xs:documentation>depreciated - for backwards compatibility with A profile</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="ELECTRICITY_PRICE">
+				<xs:annotation>
+					<xs:documentation>This is the cost of electricity</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="ENERGY_PRICE">
+				<xs:annotation>
+					<xs:documentation>This is the cost of energy</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="DEMAND_CHARGE">
+				<xs:annotation>
+					<xs:documentation>This is the demand charge</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="BID_PRICE">
+				<xs:annotation>
+					<xs:documentation>This is the price that was bid by the resource</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="BID_LOAD">
+				<xs:annotation>
+					<xs:documentation>This is the amount of load that was bid by a resource into a program</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="BID_ENERGY">
+				<xs:annotation>
+					<xs:documentation>This is the amount of energy from a resource that was bid into a program</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="CHARGE_STATE">
+				<xs:annotation>
+					<xs:documentation>State of energy storage resource</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="LOAD_DISPATCH">
+				<xs:annotation>
+					<xs:documentation>This is used to dispatch load</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="LOAD_CONTROL">
+				<xs:annotation>
+					<xs:documentation>Set load output to relative values</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- ***** extended eiEventSignals to include Baselines***** -->
+	<xs:element name="eiEventSignals" type="ei:eiEventSignalsType">
+		<xs:annotation>
+			<xs:documentation>Interval data for one or more event signals and/or baselines</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="eiEventSignalsType">
+		<xs:sequence>
+			<xs:element ref="ei:eiEventSignal" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Interval data for an event</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:eiEventBaseline" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Interval data for a baseline</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<!--########## Baselines ########## -->
+	<xs:element name="eiEventBaseline" type="ei:eiEventBaselineType">
+		<xs:annotation>
+			<xs:documentation>B profile</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="eiEventBaselineType">
+		<xs:sequence>
+			<xs:element ref="xcal:dtstart"/>
+			<xs:element ref="xcal:duration"/>
+			<xs:element ref="strm:intervals"/>
+			<xs:element name="baselineID" type="xs:string">
+				<xs:annotation>
+					<xs:documentation>Unique ID for a specific baseline</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:resourceID" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="baselineName" type="xs:string">
+				<xs:annotation>
+					<xs:documentation>Descriptive name for baseline</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="emix:itemBase" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>This is the unit of the signal.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- ########## eiOpt Section ########## -->
+	<!-- EiOpt -->
+	<xs:complexType name="EiOptType">
+		<xs:annotation>
+			<xs:documentation>Opts are used by the VEN to temporarily override the pre-existing agreement. For example, a VEN may opt in to events during the evening, or opt out from events during the world series.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="ei:optID"/>
+			<xs:element ref="ei:optType"/>
+			<xs:element ref="ei:optReason"/>
+			<xs:element ref="emix:marketContext" minOccurs="0"/>
+			<xs:element ref="ei:venID"/>
+			<xs:element ref="xcal:vavailability" minOccurs="0"/>
+			<xs:element ref="ei:createdDateTime"/>
+		</xs:sequence>
+		<xs:attribute ref="ei:schemaVersion" use="optional"/>
+	</xs:complexType>
+	<!-- optReason - same as in EIClasses -->
+	<xs:element name="optReason" type="ei:OptReasonType">
+		<xs:annotation>
+			<xs:documentation>Enumerated value for the opt reason such as x-schedule</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:simpleType name="OptReasonType">
+		<xs:annotation>
+			<xs:documentation>Reason for opting.</xs:documentation>
+		</xs:annotation>
+		<xs:union memberTypes="ei:OptReasonEnumeratedType ei:EiExtensionTokenType"/>
+	</xs:simpleType>
+	<xs:element name="optReasonEnumerated" type="ei:OptReasonEnumeratedType"/>
+	<xs:simpleType name="OptReasonEnumeratedType">
+		<xs:annotation>
+			<xs:documentation>Enumerated reasons for opting.</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="economic"/>
+			<xs:enumeration value="emergency"/>
+			<xs:enumeration value="mustRun"/>
+			<xs:enumeration value="notParticipating"/>
+			<xs:enumeration value="outageRunStatus"/>
+			<xs:enumeration value="overrideStatus"/>
+			<xs:enumeration value="participating"/>
+			<xs:enumeration value="x-schedule"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- optID - same as in EIClasses -->
+	<xs:element name="optID" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>Identifier for an opt interaction</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!-- ########## Reports Section ########## -->
+	<xs:element name="eiReportID" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>Reference ID for a report</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="reportRequestID" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>Identifier for a particular report request</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="reportSpecifierID" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>Identifier for a particular Metadata report specification</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="reportName" type="ei:reportNameType">
+		<xs:annotation>
+			<xs:documentation>Optional name for a report.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:simpleType name="reportNameType">
+		<xs:union memberTypes="ei:reportNameEnumeratedType ei:EiExtensionTokenType"/>
+	</xs:simpleType>
+	<xs:simpleType name="reportNameEnumeratedType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="METADATA_HISTORY_USAGE"/>
+			<xs:enumeration value="HISTORY_USAGE"/>
+			<xs:enumeration value="METADATA_HISTORY_GREENBUTTON"/>
+			<xs:enumeration value="HISTORY_GREENBUTTON"/>
+			<xs:enumeration value="METADATA_TELEMETRY_USAGE"/>
+			<xs:enumeration value="TELEMETRY_USAGE"/>
+			<xs:enumeration value="METADATA_TELEMETRY_STATUS"/>
+			<xs:enumeration value="TELEMETRY_STATUS"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:element name="rID" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>ReferenceID for this data point</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="reportSubject" type="ei:EiTargetType">
+		<xs:annotation>
+			<xs:documentation>Device Class target - use only endDeviceAsset.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="reportDataSource" type="ei:EiTargetType">
+		<xs:annotation>
+			<xs:documentation>Sources for data in this report. Examples include meters or submeters. For example, if a meter is capable of providing two different types of measurements, then each measurement stream would be separately identified.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="statusDateTime" type="xcal:DateTimeType">
+		<xs:annotation>
+			<xs:documentation>Date and time this artifact references.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:element name="reportType" type="ei:ReportTypeType"/>
+	<xs:simpleType name="ReportTypeType">
+		<xs:annotation>
+			<xs:documentation>An enumerated value that gives the type of report being provided.</xs:documentation>
+		</xs:annotation>
+		<xs:union memberTypes="ei:ReportEnumeratedType ei:EiExtensionTokenType"/>
+	</xs:simpleType>
+	<xs:element name="reportEnumerated" type="ei:ReportEnumeratedType"/>
+	<xs:simpleType name="ReportEnumeratedType">
+		<xs:annotation>
+			<xs:documentation>Enumerated report types</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="reading">
+				<xs:annotation>
+					<xs:documentation>Report indicates a reading, as from a meter. Readings are moments in time-changes over time can be computed from the difference between successive readings. Payload type is float</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="usage">
+				<xs:annotation>
+					<xs:documentation>Report indicates an amount of units (denominated in ItemBase or in the EMIX Product) over a period. Payload type is Quantity. A typical ItemBase is Real Energy.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="demand">
+				<xs:annotation>
+					<xs:documentation>Report indicates an amount of units (denominated in ItemBase or in the EMIX Product). Payload type is Quantity. A typical ItemBase is Real Power.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="setPoint">
+				<xs:annotation>
+					<xs:documentation>Report indicates the amount (denominated in ItemBase or in the EMIX Product) currently set. May be a confirmation/return of the setpoint control value sent from the VTN. Payload type is Quantity. A typical ItemBase is Real Power.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="deltaUsage">
+				<xs:annotation>
+					<xs:documentation>Change in usage as compared to the baseline. See usage for more information</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="deltaSetPoint">
+				<xs:annotation>
+					<xs:documentation>Changes in setpoint from previous schedule.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="deltaDemand">
+				<xs:annotation>
+					<xs:documentation>Change in demand as compared to the baseline. See demand for more information</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="baseline">
+				<xs:annotation>
+					<xs:documentation>Can be demand or usage, as indicated by ItemBase. Indicates what [measurement] would be if not for the event or regulation. Report is of the format Baseline.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="deviation">
+				<xs:annotation>
+					<xs:documentation>Difference between some instruction and actual state.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="avgUsage">
+				<xs:annotation>
+					<xs:documentation>Average usage over the duration indicated by the Granularity. See usage for more information.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="avgDemand">
+				<xs:annotation>
+					<xs:documentation>Average usage over the duration indicated by the Granularity. See demand for more information.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="operatingState">
+				<xs:annotation>
+					<xs:documentation>Generalized state of a resource such as on/off, occupancy of building, etc. No ItemBase is relevant. Requires an Application Specific Payload Extension.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="upRegulationCapacityAvailable">
+				<xs:annotation>
+					<xs:documentation>Up Regulation capacity available for dispatch, expressed in EMIX Real Power. Payload is always expressed as positive Quantity.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="downRegulationCapacityAvailable">
+				<xs:annotation>
+					<xs:documentation>Down Regulation capacity available for dispatch, expressed in EMIX Real Power. Payload is always expressed as positive Quantity.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="regulationSetpoint">
+				<xs:annotation>
+					<xs:documentation>Regulation setpoint as instructed as part of regulation services</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="storedEnergy">
+				<xs:annotation>
+					<xs:documentation>Stored Energy is expressed as Real Energy and Payload is expressed as a Quantity.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="targetEnergyStorage">
+				<xs:annotation>
+					<xs:documentation>Target Energy is expressed as Real Energy and Payload is expressed as a Quantity.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="availableEnergyStorage">
+				<xs:annotation>
+					<xs:documentation>Capacity available for further energy storage, perhaps to get to Target Energy Storage</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="price">
+				<xs:annotation>
+					<xs:documentation>Price per ItemBase at each Interval</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="level">
+				<xs:annotation>
+					<xs:documentation>Simple level from market at each Interval. Itembase is not relevant.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="powerFactor">
+				<xs:annotation>
+					<xs:documentation>Power factor for the resource.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="percentUsage">
+				<xs:annotation>
+					<xs:documentation>Percentage of usage.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="percentDemand">
+				<xs:annotation>
+					<xs:documentation>Percentage of demand</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="x-resourceStatus">
+				<xs:annotation>
+					<xs:documentation>Percentage of demand</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:element name="readingType" type="ei:ReadingTypeType">
+		<xs:annotation>
+			<xs:documentation>Metadata about the Readings, such as mean or derived</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:simpleType name="ReadingTypeType">
+		<xs:annotation>
+			<xs:documentation>Type of Reading.</xs:documentation>
+		</xs:annotation>
+		<xs:union memberTypes="ei:ReadingTypeEnumeratedType ei:EiExtensionTokenType"/>
+	</xs:simpleType>
+	<xs:element name="readingTypeEnumerated" type="ei:ReadingTypeEnumeratedType"/>
+	<xs:simpleType name="ReadingTypeEnumeratedType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="Direct Read">
+				<xs:annotation>
+					<xs:documentation>Reading is read from a device that increases monotonically, and usage must be computed from pairs of start and stop readings.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Net">
+				<xs:annotation>
+					<xs:documentation>Meter or [resource] prepares its own calculation of total use over time.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Allocated">
+				<xs:annotation>
+					<xs:documentation>Meter covers several [resources] and usage is inferred through some sort of pro data computation.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Estimated">
+				<xs:annotation>
+					<xs:documentation>Used when a reading is absent in a series in which most readings are present.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Summed">
+				<xs:annotation>
+					<xs:documentation>Several meters together provide the reading for this [resource]. This is specifically a different than aggregated, which refers to multiple [resources] in the same payload. See also Hybrid.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Derived">
+				<xs:annotation>
+					<xs:documentation>Usage is inferred through knowledge of run-time, normal operation, etc.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Mean">
+				<xs:annotation>
+					<xs:documentation>Reading is the mean value over the period indicated in Granularity</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Peak">
+				<xs:annotation>
+					<xs:documentation>Reading is Peak (highest) value over the period indicated in granularity. For some measurements, it may make more sense as the lowest value. May not be consistent with aggregate readings. Only valid for flow-rate Item Bases, i.e., Power not Energy.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Hybrid">
+				<xs:annotation>
+					<xs:documentation>If aggregated, refers to different reading types in the aggregate number.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Contract">
+				<xs:annotation>
+					<xs:documentation>Indicates reading is pro forma, i.e., is reported at agreed upon rates</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="Projected">
+				<xs:annotation>
+					<xs:documentation>Indicates reading is in the future, and has not yet been measured.</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="x-RMS">
+				<xs:annotation>
+					<xs:documentation>Root Mean Square</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+			<xs:enumeration value="x-notApplicable">
+				<xs:annotation>
+					<xs:documentation>Not Applicable</xs:documentation>
+				</xs:annotation>
+			</xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:element name="confidence" type="ei:ConfidenceType"/>
+	<xs:simpleType name="ConfidenceType">
+		<xs:restriction base="xs:unsignedInt">
+			<xs:minInclusive value="0"/>
+			<xs:maxInclusive value="100"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:element name="accuracy" type="ei:AccuracyType"/>
+	<xs:simpleType name="AccuracyType">
+		<xs:annotation>
+			<xs:documentation>Number is in same units as the payload variable for an Interval. When present with Confidence, indicates the likely variability of the prediction. When present with ReadingType, indicates likely error of Reading.</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:float"/>
+	</xs:simpleType>
+	<!-- ***** Report Payload Type***** -->
+	<xs:complexType name="ReportPayloadType">
+		<xs:annotation>
+			<xs:documentation>Report Payload for use in Reports, snaps, and projections.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="strm:StreamPayloadBaseType">
+				<xs:sequence>
+					<xs:element ref="ei:rID">
+						<xs:annotation>
+							<xs:documentation>A reference to a metadata data point description </xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="ei:confidence" minOccurs="0">
+						<xs:annotation>
+							<xs:documentation>Likely variability of prediction: 0-100</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="ei:accuracy" minOccurs="0">
+						<xs:annotation>
+							<xs:documentation>Accuracy in same units as interval payload value</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+					<xs:element ref="ei:payloadBase"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:element name="numDataSources" type="xs:unsignedInt"/>
+	<!-- 4.3 Report Specification -->
+	<xs:element name="reportSpecifier" type="ei:ReportSpecifierType">
+		<xs:annotation>
+			<xs:documentation>Specify data points desired in a particular report instance</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<xs:complexType name="ReportSpecifierType">
+		<xs:annotation>
+			<xs:documentation>Parameters that define the content of a Report Stream</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="ei:reportSpecifierID"/>
+			<xs:element ref="xcal:granularity">
+				<xs:annotation>
+					<xs:documentation>How frequently the [measurement] is to be recorded.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="reportBackDuration" type="xcal:DurationPropType">
+				<xs:annotation>
+					<xs:documentation>Report back with the Report-To-Date for each passing of this Duration.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="reportInterval" type="xcal:WsCalendarIntervalType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>This is the overall period of reporting.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:specifierPayload" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- 4.3.1 Specifier Payload -->
+	<xs:element name="specifierPayload" type="ei:SpecifierPayloadType"/>
+	<xs:complexType name="SpecifierPayloadType">
+		<xs:annotation>
+			<xs:documentation>Payload for use in Report Specifiers.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="ei:rID"/>
+			<xs:element ref="emix:itemBase" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>What is measured or tracked in this report (Units).</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element ref="ei:readingType"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- registrationID-->
+	<xs:element name="registrationID" substitutionGroup="ei:refID">
+		<xs:annotation>
+			<xs:documentation>Identifier for Registration transaction. Not included in response to query registration unless already registered</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!-- 9.8.2.9 Base Type for References -->
+	<xs:element name="refID" substitutionGroup="ei:uid">
+		<xs:annotation>
+			<xs:documentation>Reference ID for a particular instance, transmittal, or artifact. Note: not the same as the native ID of the object being transmitted or shared.</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+	<!-- 9.8.9 Base UID -->
+	<xs:element name="uid" type="ei:UidType" abstract="true"/>
+	<xs:simpleType name="UidType">
+		<xs:annotation>
+			<xs:documentation>Unique Identifier</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string"/>
+	</xs:simpleType>
+	<!-- schemaVersion -->
+	<xs:attribute name="schemaVersion" type="ei:schemaVersionType"/>
+	<xs:simpleType name="schemaVersionType">
+		<xs:union memberTypes="ei:schemaVersionEnumeratedType ei:EiExtensionTokenType"/>
+	</xs:simpleType>
+	<xs:simpleType name="schemaVersionEnumeratedType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="2.0a"/>
+			<xs:enumeration value="2.0b"/>
+		</xs:restriction>
+	</xs:simpleType>
+</xs:schema>

+ 33 - 0
schema/oadr_emix_20b.xsd

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- edited with XMLSpy v2010 rel. 3 (http://www.altova.com) by James Zuber (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0" xmlns:power="http://docs.oasis-open.org/ns/emix/2011/06/power" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110" targetNamespace="http://docs.oasis-open.org/ns/emix/2011/06" elementFormDefault="qualified" attributeFormDefault="qualified">
+   <xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="oadr_gml_20b.xsd"/>
+   <!-- ##### SAME AS A ##### -->
+   <!--  ******* marketContext ******** -->
+   <xs:element name="marketContext" type="emix:MarketContextType">
+      <xs:annotation>
+         <xs:documentation>A URI identifying a DR Program</xs:documentation>
+      </xs:annotation>
+   </xs:element>
+   <xs:simpleType name="MarketContextType">
+      <xs:restriction base="xs:anyURI"/>
+   </xs:simpleType>
+   <!-- ##### NEW FOR B ##### -->
+   <!--  ******* serviceArea ******** -->
+   <xs:element name="serviceArea" type="emix:ServiceAreaType"/>
+   <xs:complexType name="ServiceAreaType">
+      <xs:annotation>
+         <xs:documentation>The Service Area is the geographic region that is affected by the EMIX market condition</xs:documentation>
+      </xs:annotation>
+      <xs:sequence>
+         <xs:element ref="gml:FeatureCollection"/>
+      </xs:sequence>
+   </xs:complexType>
+   <!--  ******* itemBase (units) ******** -->
+   <xs:element name="itemBase" type="emix:ItemBaseType" abstract="true"/>
+   <xs:complexType name="ItemBaseType" abstract="true" mixed="false">
+      <xs:annotation>
+         <xs:documentation>Abstract base type for units for EMIX Product delivery, measurement, and warrants.</xs:documentation>
+      </xs:annotation>
+   </xs:complexType>
+</xs:schema>

+ 42 - 0
schema/oadr_gml_20b.xsd

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSpy v2010 rel. 3 (http://www.altova.com) by James Zuber (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml/3.2" targetNamespace="http://www.opengis.net/gml/3.2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+   <xs:element name="FeatureCollection">
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element name="location">
+               <xs:complexType>
+                  <xs:sequence>
+                     <xs:element name="Polygon">
+                        <xs:complexType>
+                           <xs:sequence>
+                              <xs:element name="exterior">
+                                 <xs:complexType>
+                                    <xs:sequence>
+                                       <xs:element name="LinearRing">
+                                          <xs:complexType>
+                                             <xs:sequence>
+                                                <xs:element ref="gml:posList"/>
+                                             </xs:sequence>
+                                          </xs:complexType>
+                                       </xs:element>
+                                    </xs:sequence>
+                                 </xs:complexType>
+                              </xs:element>
+                           </xs:sequence>
+                           <xs:attribute ref="gml:id"/>
+                        </xs:complexType>
+                     </xs:element>
+                  </xs:sequence>
+               </xs:complexType>
+            </xs:element>
+         </xs:sequence>
+         <xs:attribute ref="gml:id"/>
+      </xs:complexType>
+   </xs:element>
+   <xs:attribute name="id" type="xs:ID"/>
+   <xs:element name="posList" type="gml:doubleList"/>
+   <xs:simpleType name="doubleList">
+      <xs:list itemType="xs:double"/>
+   </xs:simpleType>
+</xs:schema>

+ 3954 - 0
schema/oadr_greenbutton.xsd

@@ -0,0 +1,3954 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns="http://naesb.org/espi" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://naesb.org/espi" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.7.20121113">
+   <xs:import namespace="http://www.w3.org/2005/Atom" schemaLocation="oadr_atom.xsd"/>
+   <!--
+=======================================
+Resource Types
+=======================================
+	-->
+   <xs:complexType name="IntervalBlock">
+      <xs:annotation>
+         <xs:documentation>Time sequence of Readings of the same ReadingType.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="IdentifiedObject">
+            <xs:sequence>
+               <xs:element name="interval" type="DateTimeInterval" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Specifies the time period during which the contained readings were taken.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="IntervalReading" type="IntervalReading" minOccurs="0" maxOccurs="unbounded"/>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="MeterReading">
+      <xs:annotation>
+         <xs:documentation>Set of values obtained from the meter.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="IdentifiedObject"/>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="ReadingType">
+      <xs:annotation>
+         <xs:documentation>Characteristics associated with all Readings included in a MeterReading.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="IdentifiedObject">
+            <xs:sequence>
+               <xs:element name="accumulationBehaviour" type="AccumulationKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code indicating how value is accumulated over time for Readings of ReadingType. </xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="commodity" type="CommodityKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for commodity classification of Readings of ReadingType.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="consumptionTier" type="Int16" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for consumption tier associated with a Reading of ReadingType.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="currency" type="Currency" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for the currency for costs associated with this ReadingType.  The valid values per the standard are defined in CurrencyCode.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="dataQualifier" type="DataQualifierKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code describing a salient attribute of Readings of ReadingType.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="defaultQuality" type="QualityOfReading" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Default value to be used if no value of ReadingQuality.quality is provided.  
+Specific format and valid values per the standard are specified in QualityOfReading.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="flowDirection" type="FlowDirectionKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Direction associated with current related Readings.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="intervalLength" type="UInt32" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Default interval length specified in seconds for Readings of ReadingType.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="kind" type="MeasurementKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for general classification of a Reading of ReadingType. </xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="phase" type="PhaseCodeKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for phase information associated with Readings of ReadingType.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="powerOfTenMultiplier" type="UnitMultiplierKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for the power of ten multiplier which, when used in combination with the uom, specifies the actual unit of measure for Readings of ReadingType.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="timeAttribute" type="TimePeriodOfInterest" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code used to specify a particular type of time interval method for Readings of ReadingType. </xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="tou" type="Int16" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for the TOU type of Readings of ReadingType.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="uom" type="UnitSymbolKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Code for the base unit of measure for Readings of ReadingType.  Used in combination with the powerOfTenMultiplier to specify the actual unit of measure</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="cpp" type="Int16" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[extension] Critical peak period (CPP) bucket the reading value is attributed to. Value 0 means not applicable. Even though CPP is usually considered a specialized form of time of use 'tou', this attribute is defined explicitly for flexibility.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="interharmonic" type="ReadingInterharmonic" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[extension] Indication of a "harmonic" or "interharmonic" basis for the measurement. Value 0 in 'numerator' and 'denominator' means not applicable.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="measuringPeriod" type="TimeAttributeKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[extension] Time attribute inherent or fundamental to the reading value (as opposed to 'macroPeriod' that supplies an "adjective" to describe aspects of a time period with regard to the measurement). It refers to the way the value was originally measured and not to the frequency at which it is reported or presented. For example, an hourly interval of consumption data would have value 'hourly' as an attribute. However in the case of an hourly sampled voltage value, the meterReadings schema would carry the 'hourly' interval size information.
+It is common for meters to report demand in a form that is measured over the course of a portion of an hour, while enterprise applications however commonly assume the demand (in kW or kVAr) normalised to 1 hour. The sytem that receives readings directly from the meter therefore must perform this transformation before publishing readings for use by the other enterprise systems. The scalar used is chosen based on the block size (not any sub-interval size).</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="argument" type="RationalNumber" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[extension] Argument used to introduce numbers into the unit of measure description where they are needed (e.g., 4 where the measure needs an argument such as CEMI(n=4)). Most arguments used in practice however will be integers (i.e., 'denominator'=1).
+Value 0 in 'numerator' and 'denominator' means not applicable.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="UsagePoint">
+      <xs:annotation>
+         <xs:documentation>Logical point on a network at which consumption or production is either physically measured (e.g., metered) or estimated (e.g., unmetered street lights).</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="IdentifiedObject">
+            <xs:sequence>
+               <xs:element name="roleFlags" type="HexBinary16" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Specifies the roles that this usage point has been assigned. Bit 1 - isMirror Bit 2 - isPremisesAggregationPoint Bit 3 - isPEV Bit 4 - isDER Bit 5 - isRevenueQuality Bit 6 - isDC Bit 7-16 - Reserved</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="ServiceCategory" type="ServiceCategory" minOccurs="0"/>
+               <xs:element name="status" type="UInt8" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Specifies the current status of this usage point. Valid values include: 0 = off 1 = on</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="ServiceDeliveryPoint" type="ServiceDeliveryPoint" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[extension] Contains service delivery point information about the UsagePoint if it does represent the service delivery point.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="ElectricPowerQualitySummary">
+      <xs:annotation>
+         <xs:documentation>A summary of power quality events. This information represents a summary of power quality information typically required by customer facility energy management systems. It is not intended to satisfy the detailed requirements of power quality monitoring. All values are as defined by measurementProtocol during the period. The standards typically also give ranges of allowed values; the information attributes are the raw measurements, not the &quot;yes/no&quot; determination by the various standards. See referenced standards for definition, measurement protocol and period.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="IdentifiedObject">
+            <xs:sequence>
+               <xs:element name="flickerPlt" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A measurement of long term Rapid Voltage Change in hundredths of a Volt. flickerPlt is derived from 2 hours of Pst values (12 values combined in cubic relationship).</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="flickerPst" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>flickerPst is a value measured over 10 minutes that characterizes the likelihood that the voltage fluctuations would result in perceptible light flicker. A value of 1.0 is designed to represent the level that 50% of people would perceive flicker in a 60 watt incandescent bulb. The value reported is represented as an integer in hundredths.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="harmonicVoltage" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A measurement of the Harmonic Voltage during the period. For DC, distortion is with respect to a signal of zero Hz.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="longInterruptions" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A count of Long Interruption events (as defined by measurementProtocol) during the summary interval period.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="mainsVoltage" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A measurement of the Mains [Signaling] Voltage during the summary interval period in uV.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="measurementProtocol" type="UInt8" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A reference to the source standard used as the measurement protocol definition. Examples are: 0 = &quot;IEEE1519-2009&quot; 1 = &quot;EN50160&quot;</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="powerFrequency" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A measurement of the power frequency during the summary interval period in uHz.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="rapidVoltageChanges" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A count of Rapid Voltage Change events during the summary interval period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="shortInterruptions" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A count of Short Interruption events during the summary interval period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="summaryInterval" type="DateTimeInterval">
+                  <xs:annotation>
+                     <xs:documentation>Interval of summary period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="supplyVoltageDips" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A count of Supply Voltage Dip events during the summary interval period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="supplyVoltageImbalance" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A count of Supply Voltage Imbalance events during the summary interval period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="supplyVoltageVariations" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A count of Supply Voltage Variations during the summary interval period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="tempOvervoltage" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A count of Temporary Overvoltage events (as defined by measurementProtocol) during the summary interval period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="ElectricPowerUsageSummary">
+      <xs:annotation>
+         <xs:documentation>Summary of usage for a billing period</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="IdentifiedObject">
+            <xs:sequence>
+               <xs:element name="billingPeriod" type="DateTimeInterval" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The billing period to which the included measurements apply</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="billLastPeriod" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The amount of the bill for the previous billing period , in hundred-thousandths of the currency specified in the ReadingType for this reading (e.g., 840 = USD, US dollar).</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="billToDate" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The bill amount related to the billing period as of the date received, in hundred-thousandths of the currency specified in the ReadingType for this reading. (e.g., 840 = USD, US dollar).</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="costAdditionalLastPeriod" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Additional charges from the last billing period, in hundred-thousandths of the currency specified in the ReadingType for this reading. (e.g., 840 = USD, US dollar).</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="costAdditionalDetailLastPeriod" type="LineItem" minOccurs="0" maxOccurs="unbounded">
+                  <xs:annotation>
+                     <xs:documentation>[extension] Additional charges from the last billing period which in total add up to costAdditionalLastPeriod</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="currency" type="Currency" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The ISO 4217 code indicating the currency applicable to the bill amounts in the summary. See list at http://tiny.cc/4217</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="overallConsumptionLastPeriod" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[extension] The amount of energy consumed in the last billing period.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="currentBillingPeriodOverAllConsumption" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The total consumption for the billing period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="currentDayLastYearNetConsumption" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The amount of energy consumed one year ago interpreted as same day of week same week of year (see ISO 8601).</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="currentDayNetConsumption" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Net consumption for the current day (delivered - received)</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="currentDayOverallConsumption" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Overall energy consumption for the current day</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="peakDemand" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Peak demand recorded for the current period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="previousDayLastYearOverallConsumption" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The amount of energy consumed on the previous day one year ago interpreted as same day of week same week of year (see ISO 8601).</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="previousDayNetConsumption" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Net consumption for the previous day</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="previousDayOverallConsumption" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The total consumption for the previous day</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="qualityOfReading" type="QualityOfReading" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Indication of the quality of the summary readings</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="ratchetDemand" type="SummaryMeasurement" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The current ratchet demand value for the ratchet demand period</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="ratchetDemandPeriod" type="DateTimeInterval" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The period over which the ratchet demand applies</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="statusTimeStamp" type="TimeType">
+                  <xs:annotation>
+                     <xs:documentation>Date/Time status of this UsageSummary</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="TimeConfiguration">
+      <xs:annotation>
+         <xs:documentation>[extension] Contains attributes related to the configuration of the time service.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="IdentifiedObject">
+            <xs:sequence>
+               <xs:element name="dstEndRule" type="DstRuleType">
+                  <xs:annotation>
+                     <xs:documentation>Rule to calculate end of daylight savings time in the current year.  Result of dstEndRule must be greater than result of dstStartRule.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="dstOffset" type="TimeType">
+                  <xs:annotation>
+                     <xs:documentation>Daylight savings time offset from local standard time.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="dstStartRule" type="DstRuleType">
+                  <xs:annotation>
+                     <xs:documentation>Rule to calculate start of daylight savings time in the current year. Result of dstEndRule must be greater than result of dstStartRule.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="tzOffset" type="TimeType">
+                  <xs:annotation>
+                     <xs:documentation>Local time zone offset from UTCTime. Does not include any daylight savings time offsets.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <!--
+=======================================
+Other EUI Types
+=======================================
+-->
+   <xs:complexType name="IntervalReading">
+      <xs:annotation>
+         <xs:documentation>Specific value measured by a meter or other asset. Each Reading is associated with a specific ReadingType.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="cost" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[correction] Specifies a cost associated with this reading, in hundred-thousandths of the currency specified in the ReadingType for this reading. (e.g., 840 = USD, US dollar)</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="ReadingQuality" type="ReadingQuality" minOccurs="0" maxOccurs="unbounded"/>
+               <xs:element name="timePeriod" type="DateTimeInterval" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The date time and duration of a reading. If not specified, readings for each &quot;intervalLength&quot; in ReadingType are present.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="value" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[correction] Value in units specified by ReadingType</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="ReadingQuality">
+      <xs:annotation>
+         <xs:documentation>Quality of a specific reading value or interval reading value. Note that more than one Quality may be applicable to a given Reading. Typically not used unless problems or unusual conditions occur (i.e., quality for each Reading is assumed to be &#39;Good&#39; (valid) unless stated otherwise in associated ReadingQuality).</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="quality" type="QualityOfReading">
+                  <xs:annotation>
+                     <xs:documentation>Quality, to be specified if different than ReadingType.defaultQuality. The specific format is specified per the standard is defined in QualityOfReading.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="ServiceCategory">
+      <xs:annotation>
+         <xs:documentation>Category of service provided to the customer.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="kind" type="ServiceKind">
+                  <xs:annotation>
+                     <xs:documentation>Service classification Examples are: 0 - electricity 1 - gas The list of specific valid values per the standard are itemized in ServiceKind.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="SummaryMeasurement">
+      <xs:annotation>
+         <xs:documentation>An aggregated summary measurement reading.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="powerOfTenMultiplier" type="UnitMultiplierKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The multiplier part of the unit of measure, e.g. &quot;kilo&quot; (k)</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="timeStamp" type="TimeType" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The date and time (if needed) of the summary measurement.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="uom" type="UnitSymbolKind" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The units of the reading, e.g. &quot;Wh&quot;</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="value" type="Int48" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The value of the summary measurement.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="BatchItemInfo">
+      <xs:annotation>
+         <xs:documentation>Includes elements that make it possible to include multiple transactions in a single (batch) request.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="name" type="HexBinary16" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>An identifier for this object that is only unique within the containing collection.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="operation" type="CRUDOperation" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Specifies the operation requested of this item.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="statusCode" type="StatusCode" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Indicates the status code of the associated transaction.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="statusReason" type="String256" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Indicates the reason for the indicated status code.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="ServiceDeliveryPoint">
+      <xs:annotation>
+         <xs:documentation>[extension] Service Delivery Point is representation of revenue UsagePoint attributes</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="name" type="String256" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>The name is any free human readable and possibly non unique text naming the object.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="tariffProfile" type="String256" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>A schedule of charges; structure associated with Tariff that allows the definition of complex tariff structures such as step and time of use.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="customerAgreement" type="String256" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>Agreement between the customer and the ServiceSupplier to pay for service at a specific service location. It provides for the recording of certain billing information about the type of service provided at the service location and is used during charge creation to determine the type of service.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <!--
+=======================================
+Basic Types     
+=======================================
+-->
+   <xs:simpleType name="HexBinary128">
+      <xs:annotation>
+         <xs:documentation>A 128-bit field encoded as a hex string (32 characters / 16 octets)</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:hexBinary">
+         <xs:maxLength value="16"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="HexBinary32">
+      <xs:annotation>
+         <xs:documentation>A 32-bit field encoded as a hex string (8 characters / 4 octets)</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:hexBinary">
+         <xs:maxLength value="4"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="HexBinary16">
+      <xs:annotation>
+         <xs:documentation>A 16-bit field encoded as a hex string (4 characters / 2 octets)</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:hexBinary">
+         <xs:maxLength value="2"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="HexBinary8">
+      <xs:annotation>
+         <xs:documentation>An 8-bit field encoded as a hex string (2 characters / 1 octets)</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:hexBinary">
+         <xs:maxLength value="1"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="String256">
+      <xs:annotation>
+         <xs:documentation>Character string of max length 256</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:string">
+         <xs:maxLength value="256"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="String32">
+      <xs:annotation>
+         <xs:documentation>Character string of max length 32</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:string">
+         <xs:maxLength value="32"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="String64">
+      <xs:annotation>
+         <xs:documentation>Character string of max length 64</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:string">
+         <xs:maxLength value="64"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="UInt16">
+      <xs:annotation>
+         <xs:documentation>Unsigned integer, max inclusive 65535 (2^16-1), same as xs:unsignedShort</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:unsignedShort"/>
+   </xs:simpleType>
+   <xs:simpleType name="UInt32">
+      <xs:annotation>
+         <xs:documentation>Unsigned integer, max inclusive 4294967295 (2^32-1), same as xs:unsignedInt</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:unsignedInt"/>
+   </xs:simpleType>
+   <xs:simpleType name="UInt48">
+      <xs:annotation>
+         <xs:documentation>Unsigned integer, max inclusive 281474976710655 (2^48-1), restriction of xs:unsignedLong</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:unsignedLong">
+         <xs:maxInclusive value="281474976710655"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="UInt8">
+      <xs:annotation>
+         <xs:documentation>Unsigned integer, max inclusive 255 (2^8-1), same as xs:unsignedByte</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:unsignedByte"/>
+   </xs:simpleType>
+   <xs:simpleType name="Int48">
+      <xs:annotation>
+         <xs:documentation>Signed integer, max inclusive -140737488355327 to +140737488355327 (2^47-1), restriction of xs:long</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:long">
+         <xs:minInclusive value="-140737488355328"/>
+         <xs:maxInclusive value="140737488355328"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType name="Int16">
+      <xs:annotation>
+         <xs:documentation>Signed integer, max inclusive (2^16-1), restriction of xs:short</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:short"/>
+   </xs:simpleType>
+   <xs:simpleType name="TimeType">
+      <xs:annotation>
+         <xs:documentation>Time is a signed 64-bit value representing the number of seconds since 0 hours, 0 minutes, 0 seconds, on the 1st of January, 1970.</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:long"/>
+   </xs:simpleType>
+   <!--
+=======================================
+Additional Complex Types        
+=======================================
+-->
+   <xs:complexType name="DateTimeInterval">
+      <xs:annotation>
+         <xs:documentation>Interval of date and time. End is not included because it can be derived from the start and the duration.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="duration" type="UInt32" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[correction] Duration of the interval, in seconds.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+               <xs:element name="start" type="TimeType" minOccurs="0">
+                  <xs:annotation>
+                     <xs:documentation>[correction] Date and time that this interval started.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="IdentifiedObject">
+      <xs:annotation>
+         <xs:documentation>This is a root class to provide common naming attributes for all classes needing naming attributes</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="batchItemInfo" type="BatchItemInfo" minOccurs="0"/>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:simpleType name="UUIDType">
+      <xs:annotation>
+         <xs:documentation>This pattern defines a UUID </xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:string">
+         <xs:pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <xs:complexType name="Object">
+      <xs:annotation>
+         <xs:documentation>Superclass of all object classes to allow extensions.</xs:documentation>
+      </xs:annotation>
+      <xs:sequence>
+         <xs:element name="extension" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
+            <xs:annotation>
+               <xs:documentation>Contains an extension.</xs:documentation>
+            </xs:annotation>
+         </xs:element>
+      </xs:sequence>
+   </xs:complexType>
+   <xs:complexType name="ServiceStatus">
+      <xs:annotation>
+         <xs:documentation>Contains the current status of the service.</xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+         <xs:extension base="Object">
+            <xs:sequence>
+               <xs:element name="currentStatus" type="ESPIServiceStatus">
+                  <xs:annotation>
+                     <xs:documentation>The current status of the service.</xs:documentation>
+                  </xs:annotation>
+               </xs:element>
+            </xs:sequence>
+         </xs:extension>
+      </xs:complexContent>
+   </xs:complexType>
+   <xs:complexType name="RationalNumber">
+      <xs:annotation>
+         <xs:documentation>[extension] Rational number = 'numerator' / 'denominator'.</xs:documentation>
+      </xs:annotation>
+      <xs:sequence>
+         <xs:element name="numerator" type="xs:integer" minOccurs="0"/>
+         <xs:element name="denominator" minOccurs="0"/>
+      </xs:sequence>
+   </xs:complexType>
+   <xs:complexType name="ReadingInterharmonic">
+      <xs:annotation>
+         <xs:documentation>[extension] Interharmonics are represented as a rational number 'numerator' / 'denominator', and harmonics are represented using the same mechanism and identified by 'denominator'=1.</xs:documentation>
+      </xs:annotation>
+      <xs:sequence>
+         <xs:element name="numerator" type="xs:integer" minOccurs="0"/>
+         <xs:element name="denominator" minOccurs="0"/>
+      </xs:sequence>
+   </xs:complexType>
+   <xs:complexType name="LineItem">
+      <xs:annotation>
+         <xs:documentation>[extension] Line item of detail for additional cost</xs:documentation>
+      </xs:annotation>
+      <xs:sequence>
+         <xs:element name="amount" type="Int48"/>
+         <xs:element name="rounding" type="Int48" minOccurs="0"/>
+         <xs:element name="dateTime" type="TimeType"/>
+         <xs:element name="note" type="String256"/>
+      </xs:sequence>
+   </xs:complexType>
+   <!--
+=======================================
+Enumerations 
+=======================================
+-->
+   <xs:simpleType name="AccumulationKind">
+      <xs:annotation>
+         <xs:documentation>Code indicating how value is accumulated over time for Readings of ReadingType. The list of valid values per the standard are defined in AccumulationBehaviorType.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable, or implied by the unit of measure.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>bulkQuantity</xs:appinfo>
+                     <xs:documentation>A value from a register which represents the bulk quantity of a commodity. This quantity is computed as the integral of the commodity usage rate. This value is typically used as the basis for the dial reading at the meter, and as a result, will roll over upon reaching a maximum dial value. Note 1: With the metering system, the roll-over behaviour typically implies a roll-under behavior so that the value presented is always a positive value (e.g. unsigned integer or positive decimal.) However, when communicating data between enterprise applications a negative value might occur in a case such as net metering.Note 2: A BulkQuantity refers primarily to the dial reading and not the consumption over a specific period of time.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>continuousCumulative</xs:appinfo>
+                     <xs:documentation>The sum of the previous billing period values and the present period value. Note: “ContinuousCumulative” is commonly used in conjunction with “demand.” The “ContinuousCumulative Demand” would be the cumulative sum of the previous billing period maximum demand values (as occurring with each demand reset) summed with the present period maximum demand value (which has yet to be reset.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>cumulative</xs:appinfo>
+                     <xs:documentation>The sum of the previous billing period values. Note: “Cumulative” is commonly used in conjunction with “demand.” Each demand reset causes the maximum demand value for the present billing period (since the last demand reset) to accumulate as an accumulative total of all maximum demands. So instead of “zeroing” the demand register, a demand reset has the affect of adding the present maximum demand to this accumulating total.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>deltaData</xs:appinfo>
+                     <xs:documentation>The difference between the value at the end of the prescribed interval and the beginning of the interval. This is used for incremental interval data. Note: One common application would be for load profile data, another use might be to report the number of events within an interval (such as the number of equipment energizations within the specified period of time.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="6">
+                  <xs:annotation>
+                     <xs:appinfo>indicating</xs:appinfo>
+                     <xs:documentation>As if a needle is swung out on the meter face to a value to indicate the current value. (Note: An “indicating” value is typically measured over hundreds of milliseconds or greater, or may imply a “pusher” mechanism to capture a value. Compare this to “instantaneous” which is measured over a shorter period of time.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>summation</xs:appinfo>
+                     <xs:documentation>A form of accumulation which is selective with respect to time. Note : “Summation” could be considered a specialization of “Bulk Quantity” according to the rules of inheritance where “Summation” selectively accumulates pulses over a timing pattern, and “BulkQuantity” accumulates pulses all of the time.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="10">
+                  <xs:annotation>
+                     <xs:appinfo>timeDelay</xs:appinfo>
+                     <xs:documentation>A form of computation which introduces a time delay characteristic to the data value</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="12">
+                  <xs:annotation>
+                     <xs:appinfo>instantaneous</xs:appinfo>
+                     <xs:documentation>Typically measured over the fastest period of time allowed by the definition of the metric (usually milliseconds or tens of milliseconds.) (Note: “Instantaneous” was moved to attribute #3 in 61968-9Ed2 from attribute #1 in 61968-9Ed1.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="13">
+                  <xs:annotation>
+                     <xs:appinfo>latchingQuantity</xs:appinfo>
+                     <xs:documentation>When this description is applied to a metered value, it implies that the value is a time-independent cumulative quantity much a BulkQuantity, except that it latches upon the maximum value upon reaching that value. Any additional accumulation (positive or negative) is discarded until a reset occurs. Note: A LatchingQuantity may also occur in the downward direction – upon reaching a minimum value. The terms “maximum” or “minimum” will usually be included as an attribute when this type of accumulation behaviour is present.When this description is applied to an encoded value (UOM= “Code”), it implies that the value has one or more bits which are latching. The condition that caused the bit to be set may have long since evaporated.In either case, the timestamp that accompanies the value may not coincide with the moment the value was initially set.In both cases a system will need to perform an operation to clear the latched value.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="14">
+                  <xs:annotation>
+                     <xs:appinfo>boundedQuantity</xs:appinfo>
+                     <xs:documentation>A time-independent cumulative quantity much a BulkQuantity or a LatchingQuantity, except that the accumulation stops at the maximum or minimum values. When the maximum is reached, any additional positive accumulation is discarded, but negative accumulation may be accepted (thus lowering the counter.) Likewise, when the negative bound is reached, any additional negative accumulation is discarded, but positive accumulation is accepted (thus increasing the counter.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="CommodityKind">
+      <xs:annotation>
+         <xs:documentation>Code for commodity classification of Readings of ReadingType. The valid values per the standard are defined in CommodityType.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>electricity SecondaryMetered</xs:appinfo>
+                     <xs:documentation>All types of metered quantities. This type of reading comes from the meter and represents a “secondary” metered value.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>electricity PrimaryMetere</xs:appinfo>
+                     <xs:documentation>It is possible for a meter to be outfitted with an external VT and/or CT. The meter might not be aware of these devices, and the display not compensate for their presence. Ultimately, when these scalars are applied, the value that represents the service value is called the “primary metered” value. The “index” in sub-category 3 mirrors those of sub-category 0.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>communication</xs:appinfo>
+                     <xs:documentation>A measurement of the communication infrastructure itself.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>air</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>insulativeGas</xs:appinfo>
+                     <xs:documentation>(SF6 is found separately below.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="6">
+                  <xs:annotation>
+                     <xs:appinfo>insulativeOil</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>naturalGas</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>propane</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>potableWater</xs:appinfo>
+                     <xs:documentation>Drinkable water</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="10">
+                  <xs:annotation>
+                     <xs:appinfo>steam</xs:appinfo>
+                     <xs:documentation>Water in steam form, usually used for heating.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="11">
+                  <xs:annotation>
+                     <xs:appinfo>wasteWater</xs:appinfo>
+                     <xs:documentation>(Sewerage)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="12">
+                  <xs:annotation>
+                     <xs:appinfo>heatingFluid</xs:appinfo>
+                     <xs:documentation>This fluid is likely in liquid form. It is not necessarily water or water based. The warm fluid returns cooler than when it was sent. The heat conveyed may be metered.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="13">
+                  <xs:annotation>
+                     <xs:appinfo>coolingFluid</xs:appinfo>
+                     <xs:documentation>The cool fluid returns warmer than when it was sent. The heat conveyed may be metered.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="14">
+                  <xs:annotation>
+                     <xs:appinfo>nonpotableWater</xs:appinfo>
+                     <xs:documentation>Reclaimed water – possibly used for irrigation but not sufficiently treated to be considered safe for drinking.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="15">
+                  <xs:annotation>
+                     <xs:appinfo>nox</xs:appinfo>
+                     <xs:documentation>Nitrous Oxides NOX</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="16">
+                  <xs:annotation>
+                     <xs:appinfo>so2</xs:appinfo>
+                     <xs:documentation>Sulfur Dioxide SO2</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="17">
+                  <xs:annotation>
+                     <xs:appinfo>ch4</xs:appinfo>
+                     <xs:documentation>Methane CH4</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="18">
+                  <xs:annotation>
+                     <xs:appinfo>co2</xs:appinfo>
+                     <xs:documentation>Carbon Dioxide CO2</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="19">
+                  <xs:annotation>
+                     <xs:appinfo>carbon</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="20">
+                  <xs:annotation>
+                     <xs:appinfo>hch</xs:appinfo>
+                     <xs:documentation>Hexachlorocyclohexane HCH</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="21">
+                  <xs:annotation>
+                     <xs:appinfo>pfc</xs:appinfo>
+                     <xs:documentation>Perfluorocarbons PFC</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="22">
+                  <xs:annotation>
+                     <xs:appinfo>sf6</xs:appinfo>
+                     <xs:documentation>Sulfurhexafluoride SF6</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="23">
+                  <xs:annotation>
+                     <xs:appinfo>tvLicence</xs:appinfo>
+                     <xs:documentation>Television</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="24">
+                  <xs:annotation>
+                     <xs:appinfo>internet</xs:appinfo>
+                     <xs:documentation>Internet service</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="25">
+                  <xs:annotation>
+                     <xs:appinfo>refuse</xs:appinfo>
+                     <xs:documentation>trash</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="Currency">
+      <xs:annotation>
+         <xs:documentation>Code for the currency for costs associated with this ReadingType.  The valid values per the standard are defined in CurrencyCode.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="840">
+                  <xs:annotation>
+                     <xs:appinfo>USD</xs:appinfo>
+                     <xs:documentation>US dollar</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="978">
+                  <xs:annotation>
+                     <xs:appinfo>EUR</xs:appinfo>
+                     <xs:documentation>European euro</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="36">
+                  <xs:annotation>
+                     <xs:appinfo>AUD</xs:appinfo>
+                     <xs:documentation>Australian dollar</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="124">
+                  <xs:annotation>
+                     <xs:appinfo>CAD</xs:appinfo>
+                     <xs:documentation>Canadian dollar</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="756">
+                  <xs:annotation>
+                     <xs:appinfo>CHF</xs:appinfo>
+                     <xs:documentation>Swiss francs</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="156">
+                  <xs:annotation>
+                     <xs:appinfo>CNY</xs:appinfo>
+                     <xs:documentation>Chinese yuan renminbi</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="208">
+                  <xs:annotation>
+                     <xs:appinfo>DKK</xs:appinfo>
+                     <xs:documentation>Danish crown</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="826">
+                  <xs:annotation>
+                     <xs:appinfo>GBP</xs:appinfo>
+                     <xs:documentation>British pound</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="392">
+                  <xs:annotation>
+                     <xs:appinfo>JPY</xs:appinfo>
+                     <xs:documentation>Japanese yen</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="578">
+                  <xs:annotation>
+                     <xs:appinfo>NOK</xs:appinfo>
+                     <xs:documentation>Norwegian crown</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="643">
+                  <xs:annotation>
+                     <xs:appinfo>RUB</xs:appinfo>
+                     <xs:documentation>Russian ruble</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="752">
+                  <xs:annotation>
+                     <xs:appinfo>SEK</xs:appinfo>
+                     <xs:documentation>Swedish crown</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="356">
+                  <xs:annotation>
+                     <xs:appinfo>INR</xs:appinfo>
+                     <xs:documentation>India rupees</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>other</xs:appinfo>
+                     <xs:documentation>Another type of currency.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="DataQualifierKind">
+      <xs:annotation>
+         <xs:documentation>Code describing a salient attribute of Readings of ReadingType. Valid values per the standard are defined in DataQualifierType.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>average</xs:appinfo>
+                     <xs:documentation>Average value</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>excess</xs:appinfo>
+                     <xs:documentation>The value represents an amount over which a threshold was exceeded.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>highThreshold</xs:appinfo>
+                     <xs:documentation>The value represents a programmed threshold.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>lowThreshold</xs:appinfo>
+                     <xs:documentation>The value represents a programmed threshold.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>maximum</xs:appinfo>
+                     <xs:documentation>The highest value observed</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>minimum</xs:appinfo>
+                     <xs:documentation>The smallest value observed</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="11">
+                  <xs:annotation>
+                     <xs:appinfo>nominal</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="12">
+                  <xs:annotation>
+                     <xs:appinfo>normal</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="16">
+                  <xs:annotation>
+                     <xs:appinfo>secondMaximum</xs:appinfo>
+                     <xs:documentation>The second highest value observed</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="17">
+                  <xs:annotation>
+                     <xs:appinfo>secondMinimum</xs:appinfo>
+                     <xs:documentation>The second smallest value observed</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="23">
+                  <xs:annotation>
+                     <xs:appinfo>thirdMaximum</xs:appinfo>
+                     <xs:documentation>The third highest value observed</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="24">
+                  <xs:annotation>
+                     <xs:appinfo>fourthMaximum</xs:appinfo>
+                     <xs:documentation>The fourth highest value observed</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="25">
+                  <xs:annotation>
+                     <xs:appinfo>fifthMaximum</xs:appinfo>
+                     <xs:documentation>The fifth highest value observed</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="26">
+                  <xs:annotation>
+                     <xs:appinfo>sum</xs:appinfo>
+                     <xs:documentation>The accumulated sum</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="FlowDirectionKind">
+      <xs:annotation>
+         <xs:documentation>Direction associated with current related Readings. valid values per the standard are defined in FlowDirectionType.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable (N/A)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>forward</xs:appinfo>
+                     <xs:documentation>"Delivered," or "Imported" as defined 61968-2.Forward Active Energy is a positive kWh value as one would naturally expect to find as energy is supplied by the utility and consumed at the service.Forward Reactive Energy is a positive VArh value as one would naturally expect to find in the presence of inductive loading.In polyphase metering, the forward energy register is incremented when the sum of the phase energies is greater than zero.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>lagging</xs:appinfo>
+                     <xs:documentation>Typically used to describe that a power factor is lagging the reference value. Note 1: When used to describe VA, “lagging” describes a form of measurement where reactive power is considered in all four quadrants, but real power is considered only in quadrants I and IV.Note 2: When used to describe power factor, the term “Lagging” implies that the PF is negative. The term “lagging” in this case takes the place of the negative sign. If a signed PF value is to be passed by the data producer, then the direction of flow enumeration zero (none) should be used in order to avoid the possibility of creating an expression that employs a double negative. The data consumer should be able to tell from the sign of the data if the PF is leading or lagging. This principle is analogous to the concept that “Reverse” energy is an implied negative value, and to publish a negative reverse value would be ambiguous.Note 3: Lagging power factors typically indicate inductive loading.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>leading</xs:appinfo>
+                     <xs:documentation>Typically used to describe that a power factor is leading the reference value.Note: Leading power factors typically indicate capacitive loading.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>net</xs:appinfo>
+                     <xs:documentation>|Forward| - |Reverse|, See 61968-2.Note: In some systems, the value passed as a “net” value could become negative. In other systems the value passed as a “net” value is always a positive number, and rolls-over and rolls-under as needed.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>q1plusQ2</xs:appinfo>
+                     <xs:documentation>Reactive positive quadrants. (The term “lagging” is preferred.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>q1plusQ3</xs:appinfo>
+                     <xs:documentation>Quadrants 1 and 3</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>q1plusQ4</xs:appinfo>
+                     <xs:documentation>Quadrants 1 and 4 usually represent forward active energy</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>q1minusQ4</xs:appinfo>
+                     <xs:documentation>Q1 minus Q4</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="10">
+                  <xs:annotation>
+                     <xs:appinfo>q2plusQ3</xs:appinfo>
+                     <xs:documentation>Quadrants 2 and 3 usually represent reverse active energy</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="11">
+                  <xs:annotation>
+                     <xs:appinfo>q2plusQ4</xs:appinfo>
+                     <xs:documentation>Quadrants 2 and 4</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="12">
+                  <xs:annotation>
+                     <xs:appinfo>q2minusQ3</xs:appinfo>
+                     <xs:documentation>Q2 minus Q3</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="13">
+                  <xs:annotation>
+                     <xs:appinfo>q3plusQ4</xs:appinfo>
+                     <xs:documentation>Reactive negative quadrants. (The term “leading” is preferred.)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="14">
+                  <xs:annotation>
+                     <xs:appinfo>q3minusQ2</xs:appinfo>
+                     <xs:documentation>Q3 minus Q2</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="15">
+                  <xs:annotation>
+                     <xs:appinfo>quadrant1</xs:appinfo>
+                     <xs:documentation>Q1 only</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="16">
+                  <xs:annotation>
+                     <xs:appinfo>quadrant2</xs:appinfo>
+                     <xs:documentation>Q2 only</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="17">
+                  <xs:annotation>
+                     <xs:appinfo>quadrant3</xs:appinfo>
+                     <xs:documentation>Q3 only</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="18">
+                  <xs:annotation>
+                     <xs:appinfo>quadrant4</xs:appinfo>
+                     <xs:documentation>Q4 only</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="19">
+                  <xs:annotation>
+                     <xs:appinfo>reverse</xs:appinfo>
+                     <xs:documentation>Reverse Active Energy is equivalent to "Received," or "Exported" as defined in 61968-2.Reverse Active Energy is a positive kWh value as one would expect to find when energy is backfed by the service onto the utility network.Reverse Reactive Energy is a positive VArh value as one would expect to find in the presence of capacitive loading and a leading Power Factor.In polyphase metering, the reverse energy register is incremented when the sum of the phase energies is less than zero.Note: The value passed as a reverse value is always a positive value. It is understood by the label “reverse” that it represents negative flow.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="20">
+                  <xs:annotation>
+                     <xs:appinfo>total</xs:appinfo>
+                     <xs:documentation>|Forward| + |Reverse|, See 61968-2.The sum of the commodity in all quadrants Q1+Q2+Q3+Q4.In polyphase metering, the total energy register is incremented when the absolute value of the sum of the phase energies is greater than zero.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="21">
+                  <xs:annotation>
+                     <xs:appinfo>totalByPhase</xs:appinfo>
+                     <xs:documentation>In polyphase metering, the total by phase energy register is incremented when the sum of the absolute values of the phase energies is greater than zero.In single phase metering, the formulas for “Total” and “Total by phase” collapse to the same expression. For communication purposes however, the “Total” enumeration should be used with single phase meter data.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="MeasurementKind">
+      <xs:annotation>
+         <xs:documentation>Name of physical measurement</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>apparentPowerFactor</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>currency</xs:appinfo>
+                     <xs:documentation>funds</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>current</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>currentAngle</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="6">
+                  <xs:annotation>
+                     <xs:appinfo>currentImbalance</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>date</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>demand</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>distance</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="10">
+                  <xs:annotation>
+                     <xs:appinfo>distortionVoltAmperes</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="11">
+                  <xs:annotation>
+                     <xs:appinfo>energization</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="12">
+                  <xs:annotation>
+                     <xs:appinfo>energy</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="13">
+                  <xs:annotation>
+                     <xs:appinfo>energizationLoadSide</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="14">
+                  <xs:annotation>
+                     <xs:appinfo>fan</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="15">
+                  <xs:annotation>
+                     <xs:appinfo>frequency</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="16">
+                  <xs:annotation>
+                     <xs:appinfo>Funds</xs:appinfo>
+                     <xs:documentation>Dup with “currency”</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="17">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366ASAI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="18">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366ASIDI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="19">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366ASIFI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="20">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366CAIDI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="21">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366CAIFI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="22">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366CEMIn</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="23">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366CEMSMIn</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="24">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366CTAIDI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="25">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366MAIFI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="26">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366MAIFIe</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="27">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366SAIDI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="28">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366SAIFI</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="31">
+                  <xs:annotation>
+                     <xs:appinfo>lineLosses</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="32">
+                  <xs:annotation>
+                     <xs:appinfo>losses</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="33">
+                  <xs:annotation>
+                     <xs:appinfo>negativeSequence</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="34">
+                  <xs:annotation>
+                     <xs:appinfo>phasorPowerFactor</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="35">
+                  <xs:annotation>
+                     <xs:appinfo>phasorReactivePower</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="36">
+                  <xs:annotation>
+                     <xs:appinfo>positiveSequence</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="37">
+                  <xs:annotation>
+                     <xs:appinfo>power</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="38">
+                  <xs:annotation>
+                     <xs:appinfo>powerFactor</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="40">
+                  <xs:annotation>
+                     <xs:appinfo>quantityPower</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="41">
+                  <xs:annotation>
+                     <xs:appinfo>sag</xs:appinfo>
+                     <xs:documentation>or Voltage Dip</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="42">
+                  <xs:annotation>
+                     <xs:appinfo>swell</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="43">
+                  <xs:annotation>
+                     <xs:appinfo>switchPosition</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="44">
+                  <xs:annotation>
+                     <xs:appinfo>tapPosition</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="45">
+                  <xs:annotation>
+                     <xs:appinfo>tariffRate</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="46">
+                  <xs:annotation>
+                     <xs:appinfo>temperature</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="47">
+                  <xs:annotation>
+                     <xs:appinfo>totalHarmonicDistortion</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="48">
+                  <xs:annotation>
+                     <xs:appinfo>transformerLosses</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="49">
+                  <xs:annotation>
+                     <xs:appinfo>unipedeVoltageDip10to15</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="50">
+                  <xs:annotation>
+                     <xs:appinfo>unipedeVoltageDip15to30</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="51">
+                  <xs:annotation>
+                     <xs:appinfo>unipedeVoltageDip30to60</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="52">
+                  <xs:annotation>
+                     <xs:appinfo>unipedeVoltageDip60to90</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="53">
+                  <xs:annotation>
+                     <xs:appinfo>unipedeVoltageDip90to100</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="54">
+                  <xs:annotation>
+                     <xs:appinfo>voltage</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="55">
+                  <xs:annotation>
+                     <xs:appinfo>voltageAngle</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="56">
+                  <xs:annotation>
+                     <xs:appinfo>voltageExcursion</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="57">
+                  <xs:annotation>
+                     <xs:appinfo>voltageImbalance</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="58">
+                  <xs:annotation>
+                     <xs:appinfo>volume</xs:appinfo>
+                     <xs:documentation>Clarified from Ed. 1. to indicate fluid volume</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="59">
+                  <xs:annotation>
+                     <xs:appinfo>zeroFlowDuration</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="60">
+                  <xs:annotation>
+                     <xs:appinfo>zeroSequence</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="64">
+                  <xs:annotation>
+                     <xs:appinfo>distortionPowerFactor</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="81">
+                  <xs:annotation>
+                     <xs:appinfo>frequencyExcursion</xs:appinfo>
+                     <xs:documentation>Usually expressed as a “count”</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="90">
+                  <xs:annotation>
+                     <xs:appinfo>applicationContext</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="91">
+                  <xs:annotation>
+                     <xs:appinfo>apTitle</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="92">
+                  <xs:annotation>
+                     <xs:appinfo>assetNumber</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="93">
+                  <xs:annotation>
+                     <xs:appinfo>bandwidth</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="94">
+                  <xs:annotation>
+                     <xs:appinfo>batteryVoltage</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="95">
+                  <xs:annotation>
+                     <xs:appinfo>broadcastAddress</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="96">
+                  <xs:annotation>
+                     <xs:appinfo>deviceAddressType1</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="97">
+                  <xs:annotation>
+                     <xs:appinfo>deviceAddressType2</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="98">
+                  <xs:annotation>
+                     <xs:appinfo>deviceAddressType3</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="99">
+                  <xs:annotation>
+                     <xs:appinfo>deviceAddressType4</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="100">
+                  <xs:annotation>
+                     <xs:appinfo>deviceClass</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="101">
+                  <xs:annotation>
+                     <xs:appinfo>electronicSerialNumber</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="102">
+                  <xs:annotation>
+                     <xs:appinfo>endDeviceID</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="103">
+                  <xs:annotation>
+                     <xs:appinfo>groupAddressType1</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="104">
+                  <xs:annotation>
+                     <xs:appinfo>groupAddressType2</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="105">
+                  <xs:annotation>
+                     <xs:appinfo>groupAddressType3</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="106">
+                  <xs:annotation>
+                     <xs:appinfo>groupAddressType4</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="107">
+                  <xs:annotation>
+                     <xs:appinfo>ipAddress</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="108">
+                  <xs:annotation>
+                     <xs:appinfo>macAddress</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="109">
+                  <xs:annotation>
+                     <xs:appinfo>mfgAssignedConfigurationID</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="110">
+                  <xs:annotation>
+                     <xs:appinfo>mfgAssignedPhysicalSerialNumber</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="111">
+                  <xs:annotation>
+                     <xs:appinfo>mfgAssignedProductNumber</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="112">
+                  <xs:annotation>
+                     <xs:appinfo>mfgAssignedUniqueCommunicationAddress</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="113">
+                  <xs:annotation>
+                     <xs:appinfo>multiCastAddress</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="114">
+                  <xs:annotation>
+                     <xs:appinfo>oneWayAddress</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="115">
+                  <xs:annotation>
+                     <xs:appinfo>signalStrength</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="116">
+                  <xs:annotation>
+                     <xs:appinfo>twoWayAddress</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="117">
+                  <xs:annotation>
+                     <xs:appinfo>signaltoNoiseRatio</xs:appinfo>
+                     <xs:documentation>Moved here from Attribute #9 UOM</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="118">
+                  <xs:annotation>
+                     <xs:appinfo>alarm</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="119">
+                  <xs:annotation>
+                     <xs:appinfo>batteryCarryover</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="120">
+                  <xs:annotation>
+                     <xs:appinfo>dataOverflowAlarm</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="121">
+                  <xs:annotation>
+                     <xs:appinfo>demandLimit</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="122">
+                  <xs:annotation>
+                     <xs:appinfo>demandReset</xs:appinfo>
+                     <xs:documentation>Usually expressed as a count as part of a billing cycle</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="123">
+                  <xs:annotation>
+                     <xs:appinfo>diagnostic</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="124">
+                  <xs:annotation>
+                     <xs:appinfo>emergencyLimit</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="125">
+                  <xs:annotation>
+                     <xs:appinfo>encoderTamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="126">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366MomentaryInterruption</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="127">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366MomentaryInterruptionEvent</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="128">
+                  <xs:annotation>
+                     <xs:appinfo>ieee1366SustainedInterruption</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="129">
+                  <xs:annotation>
+                     <xs:appinfo>interruptionBehaviour</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="130">
+                  <xs:annotation>
+                     <xs:appinfo>inversionTamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="131">
+                  <xs:annotation>
+                     <xs:appinfo>loadInterrupt</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="132">
+                  <xs:annotation>
+                     <xs:appinfo>loadShed</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="133">
+                  <xs:annotation>
+                     <xs:appinfo>maintenance</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="134">
+                  <xs:annotation>
+                     <xs:appinfo>physicalTamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="135">
+                  <xs:annotation>
+                     <xs:appinfo>powerLossTamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="136">
+                  <xs:annotation>
+                     <xs:appinfo>powerOutage</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="137">
+                  <xs:annotation>
+                     <xs:appinfo>powerQuality</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="138">
+                  <xs:annotation>
+                     <xs:appinfo>powerRestoration</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="139">
+                  <xs:annotation>
+                     <xs:appinfo>programmed</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="140">
+                  <xs:annotation>
+                     <xs:appinfo>pushbutton</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="141">
+                  <xs:annotation>
+                     <xs:appinfo>relayActivation</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="142">
+                  <xs:annotation>
+                     <xs:appinfo>relayCycle</xs:appinfo>
+                     <xs:documentation>Usually expressed as a count</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="143">
+                  <xs:annotation>
+                     <xs:appinfo>removalTamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="144">
+                  <xs:annotation>
+                     <xs:appinfo>reprogrammingTamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="145">
+                  <xs:annotation>
+                     <xs:appinfo>reverseRotationTamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="146">
+                  <xs:annotation>
+                     <xs:appinfo>switchArmed</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="147">
+                  <xs:annotation>
+                     <xs:appinfo>switchDisabled</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="148">
+                  <xs:annotation>
+                     <xs:appinfo>tamper</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="149">
+                  <xs:annotation>
+                     <xs:appinfo>watchdogTimeout</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="150">
+                  <xs:annotation>
+                     <xs:appinfo>billLastPeriod</xs:appinfo>
+                     <xs:documentation>Customer’s bill for the previous billing period (Currency)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="151">
+                  <xs:annotation>
+                     <xs:appinfo>billToDate</xs:appinfo>
+                     <xs:documentation>Customer’s bill, as known thus far within the present billing period (Currency)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="152">
+                  <xs:annotation>
+                     <xs:appinfo>billCarryover</xs:appinfo>
+                     <xs:documentation>Customer’s bill for the (Currency)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="153">
+                  <xs:annotation>
+                     <xs:appinfo>connectionFee</xs:appinfo>
+                     <xs:documentation>Monthly fee for connection to commodity.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="154">
+                  <xs:annotation>
+                     <xs:appinfo>audibleVolume</xs:appinfo>
+                     <xs:documentation>Sound</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="155">
+                  <xs:annotation>
+                     <xs:appinfo>volumetricFlow</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="PhaseCodeKind">
+      <xs:annotation>
+         <xs:documentation>Enumeration of phase identifiers. Allows designation of phases for both transmission and distribution equipment, circuits and loads.Residential and small commercial loads are often served from single-phase, or split-phase, secondary circuits. Phases 1 and 2 refer to hot wires that are 180 degrees out of phase, while N refers to the neutral wire. Through single-phase transformer connections, these secondary circuits may be served from one or two of the primary phases A, B, and C. For three-phase loads, use the A, B, C phase codes instead of s12N.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="225">
+                  <xs:annotation>
+                     <xs:appinfo>ABCN</xs:appinfo>
+                     <xs:documentation>ABC to Neutral</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="224">
+                  <xs:annotation>
+                     <xs:appinfo>ABC</xs:appinfo>
+                     <xs:documentation>Involving all phases</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="193">
+                  <xs:annotation>
+                     <xs:appinfo>ABN</xs:appinfo>
+                     <xs:documentation>AB to Neutral</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="97">
+                  <xs:annotation>
+                     <xs:appinfo>ACN</xs:appinfo>
+                     <xs:documentation>Phases A, C and neutral.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="97">
+                  <xs:annotation>
+                     <xs:appinfo>BCN</xs:appinfo>
+                     <xs:documentation>BC to neutral.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="132">
+                  <xs:annotation>
+                     <xs:appinfo>AB</xs:appinfo>
+                     <xs:documentation>Phases A to B</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="96">
+                  <xs:annotation>
+                     <xs:appinfo>AC</xs:appinfo>
+                     <xs:documentation>Phases A and C</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="66">
+                  <xs:annotation>
+                     <xs:appinfo>BC</xs:appinfo>
+                     <xs:documentation>Phases B to C</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="129">
+                  <xs:annotation>
+                     <xs:appinfo>AN</xs:appinfo>
+                     <xs:documentation>Phases A to neutral.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="65">
+                  <xs:annotation>
+                     <xs:appinfo>BN</xs:appinfo>
+                     <xs:documentation>Phases B to neutral.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="33">
+                  <xs:annotation>
+                     <xs:appinfo>CN</xs:appinfo>
+                     <xs:documentation>Phases C to neutral.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="128">
+                  <xs:annotation>
+                     <xs:appinfo>A</xs:appinfo>
+                     <xs:documentation>Phase A.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="64">
+                  <xs:annotation>
+                     <xs:appinfo>B</xs:appinfo>
+                     <xs:documentation>Phase B.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="32">
+                  <xs:annotation>
+                     <xs:appinfo>C</xs:appinfo>
+                     <xs:documentation>Phase C.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="16">
+                  <xs:annotation>
+                     <xs:appinfo>N</xs:appinfo>
+                     <xs:documentation>Neutral</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="272">
+                  <xs:annotation>
+                     <xs:appinfo>S2N</xs:appinfo>
+                     <xs:documentation>Phase S2 to neutral.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="784">
+                  <xs:annotation>
+                     <xs:appinfo>S12N</xs:appinfo>
+                     <xs:documentation>Phase S1, S2 to neutral.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="528">
+                  <xs:annotation>
+                     <xs:appinfo>S1N</xs:appinfo>
+                     <xs:documentation>Phase S1 to Neutral</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="256">
+                  <xs:annotation>
+                     <xs:appinfo>S2</xs:appinfo>
+                     <xs:documentation>Phase S2.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="768">
+                  <xs:annotation>
+                     <xs:appinfo>S12</xs:appinfo>
+                     <xs:documentation>Phase S1 to S2</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not applicable to any phase</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="136">
+                  <xs:annotation>
+                     <xs:appinfo>AtoAv</xs:appinfo>
+                     <xs:documentation>Phase A current relative to Phase A voltage</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="72">
+                  <xs:annotation>
+                     <xs:appinfo>BAv</xs:appinfo>
+                     <xs:documentation>Phase B current or voltage relative to Phase A voltage</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="41">
+                  <xs:annotation>
+                     <xs:appinfo>CAN</xs:appinfo>
+                     <xs:documentation>CA to Neutral</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="40">
+                  <xs:annotation>
+                     <xs:appinfo>CAv</xs:appinfo>
+                     <xs:documentation>hase C current or voltage relative to Phase A voltage</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="17">
+                  <xs:annotation>
+                     <xs:appinfo>NG</xs:appinfo>
+                     <xs:documentation>Neutral to ground</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="512">
+                  <xs:annotation>
+                     <xs:appinfo>S1</xs:appinfo>
+                     <xs:documentation>Phase S1</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="UnitMultiplierKind">
+      <xs:annotation>
+         <xs:documentation>The power of ten unit multipliers.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="Int16">
+         <xs:simpleType>
+            <xs:restriction base="Int16">
+               <xs:enumeration value="-12">
+                  <xs:annotation>
+                     <xs:appinfo>p</xs:appinfo>
+                     <xs:documentation>Pico 10**-12</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="-9">
+                  <xs:annotation>
+                     <xs:appinfo>n</xs:appinfo>
+                     <xs:documentation>Nano 10**-9</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="-6">
+                  <xs:annotation>
+                     <xs:appinfo>micro</xs:appinfo>
+                     <xs:documentation>Micro 10**-6</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="-3">
+                  <xs:annotation>
+                     <xs:appinfo>m</xs:appinfo>
+                     <xs:documentation>Milli 10**-3</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="-2">
+                  <xs:annotation>
+                     <xs:appinfo>c</xs:appinfo>
+                     <xs:documentation>Centi 10**-2</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="-1">
+                  <xs:annotation>
+                     <xs:appinfo>d</xs:appinfo>
+                     <xs:documentation>Deci 10**-1</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>k</xs:appinfo>
+                     <xs:documentation>Kilo 10**3</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="6">
+                  <xs:annotation>
+                     <xs:appinfo>M</xs:appinfo>
+                     <xs:documentation>Mega 10**6</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>G</xs:appinfo>
+                     <xs:documentation>Giga 10**9</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="12">
+                  <xs:annotation>
+                     <xs:appinfo>T</xs:appinfo>
+                     <xs:documentation>Tera 10**12</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable or "x1"</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>da</xs:appinfo>
+                     <xs:documentation>deca 10**1</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>h</xs:appinfo>
+                     <xs:documentation>hecto 10**2</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="QualityOfReading">
+      <xs:annotation>
+         <xs:documentation>List of codes indicating the quality of the reading</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>valid</xs:appinfo>
+                     <xs:documentation>data that has gone through all required validation checks and either passed them all or has been verified</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>manually edited</xs:appinfo>
+                     <xs:documentation>Replaced or approved by a human</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>estimated using reference day</xs:appinfo>
+                     <xs:documentation>data value was replaced by a machine computed value based on analysis of historical data using the same type of measurement.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>estimated using linear interpolation</xs:appinfo>
+                     <xs:documentation>data value was computed using linear interpolation based on the readings before and after it</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="10">
+                  <xs:annotation>
+                     <xs:appinfo>questionable</xs:appinfo>
+                     <xs:documentation>data that has failed one or more checks</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="11">
+                  <xs:annotation>
+                     <xs:appinfo>derived</xs:appinfo>
+                     <xs:documentation>data that has been calculated (using logic or mathematical operations)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="12">
+                  <xs:annotation>
+                     <xs:appinfo>projected (forecast)</xs:appinfo>
+                     <xs:documentation>data that has been calculated as a projection or forecast of future readings</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="13">
+                  <xs:annotation>
+                     <xs:appinfo>mixed</xs:appinfo>
+                     <xs:documentation>indicates that the quality of this reading has mixed characteristics</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="14">
+                  <xs:annotation>
+                     <xs:appinfo>raw</xs:appinfo>
+                     <xs:documentation>data that has not gone through the validation</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="15">
+                  <xs:annotation>
+                     <xs:appinfo>normalized for weather</xs:appinfo>
+                     <xs:documentation>the values have been adjusted to account for weather</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="16">
+                  <xs:annotation>
+                     <xs:appinfo>other</xs:appinfo>
+                     <xs:documentation>specifies that a characteristic applies other than those defined</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="17">
+                  <xs:annotation>
+                     <xs:appinfo>validated</xs:appinfo>
+                     <xs:documentation>data that has been validated and possibly edited and/or estimated in accordance with approved procedures</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="18">
+                  <xs:annotation>
+                     <xs:appinfo>verified</xs:appinfo>
+                     <xs:documentation>data that failed at least one of the required validation checks but was determined to represent actual usage</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="ServiceKind">
+      <xs:annotation>
+         <xs:documentation>Kind of service represented by the UsagePoint</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>electricity</xs:appinfo>
+                     <xs:documentation>Electricity service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>gas</xs:appinfo>
+                     <xs:documentation>Gas service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>water</xs:appinfo>
+                     <xs:documentation>Water service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>time</xs:appinfo>
+                     <xs:documentation>Time service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>heat</xs:appinfo>
+                     <xs:documentation>Heat service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>refuse</xs:appinfo>
+                     <xs:documentation>Refuse (waster) service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="6">
+                  <xs:annotation>
+                     <xs:appinfo>sewerage</xs:appinfo>
+                     <xs:documentation>Sewerage service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>rates</xs:appinfo>
+                     <xs:documentation>Rates (e.g. tax, charge, toll, duty, tariff, etc.) service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>tvLicence</xs:appinfo>
+                     <xs:documentation>TV license service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>internet</xs:appinfo>
+                     <xs:documentation>Internet service.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="TimeAttributeKind">
+      <xs:annotation>
+         <xs:documentation>Code used to specify a particular type of time interval method for Readings of ReadingType. Valid values per the standard are defined in TimeAttributeType.</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>tenMinute</xs:appinfo>
+                     <xs:documentation>10-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>fifteenMinute</xs:appinfo>
+                     <xs:documentation>15-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>oneMinute</xs:appinfo>
+                     <xs:documentation>1-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>twentyfourHour</xs:appinfo>
+                     <xs:documentation>24-hour</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>thirtyMinute</xs:appinfo>
+                     <xs:documentation>30-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="6">
+                  <xs:annotation>
+                     <xs:appinfo>fiveMinute</xs:appinfo>
+                     <xs:documentation>5-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>sixtyMinute</xs:appinfo>
+                     <xs:documentation>60-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="10">
+                  <xs:annotation>
+                     <xs:appinfo>twoMinute</xs:appinfo>
+                     <xs:documentation>2-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="14">
+                  <xs:annotation>
+                     <xs:appinfo>threeMinute</xs:appinfo>
+                     <xs:documentation>3-minute</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="15">
+                  <xs:annotation>
+                     <xs:appinfo>present</xs:appinfo>
+                     <xs:documentation>Within the present period of time</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="16">
+                  <xs:annotation>
+                     <xs:appinfo>previous</xs:appinfo>
+                     <xs:documentation>Shifted within the previous monthly cycle and data set</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="31">
+                  <xs:annotation>
+                     <xs:appinfo>twentyMinute</xs:appinfo>
+                     <xs:documentation>20-minute interval</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="50">
+                  <xs:annotation>
+                     <xs:appinfo>fixedBlock60Min</xs:appinfo>
+                     <xs:documentation>60-minute Fixed Block</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="51">
+                  <xs:annotation>
+                     <xs:appinfo>fixedBlock30Min</xs:appinfo>
+                     <xs:documentation>30-minute Fixed Block</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="52">
+                  <xs:annotation>
+                     <xs:appinfo>fixedBlock20Min</xs:appinfo>
+                     <xs:documentation>20-minute Fixed Block</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="53">
+                  <xs:annotation>
+                     <xs:appinfo>fixedBlock15Min</xs:appinfo>
+                     <xs:documentation>15-minute Fixed Block</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="54">
+                  <xs:annotation>
+                     <xs:appinfo>fixedBlock10Min</xs:appinfo>
+                     <xs:documentation>10-minute Fixed Block</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="55">
+                  <xs:annotation>
+                     <xs:appinfo>fixedBlock5Min</xs:appinfo>
+                     <xs:documentation>5-minute Fixed Block</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="56">
+                  <xs:annotation>
+                     <xs:appinfo>fixedBlock1Min</xs:appinfo>
+                     <xs:documentation>1-minute Fixed Block</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="57">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl30MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 30-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="58">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl20MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 20-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="59">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl15MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 15-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="60">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl12MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 12-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="61">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl10MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 10-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="62">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl6MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 6-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="63">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl5MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 5-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="64">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock60MinIntvl4MinSubIntvl</xs:appinfo>
+                     <xs:documentation>60-minute Rolling Block with 4-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="65">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock30MinIntvl15MinSubIntvl</xs:appinfo>
+                     <xs:documentation>30-minute Rolling Block with 15-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="66">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock30MinIntvl10MinSubIntvl</xs:appinfo>
+                     <xs:documentation>30-minute Rolling Block with 10-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="67">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock30MinIntvl6MinSubIntvl</xs:appinfo>
+                     <xs:documentation>30-minute Rolling Block with 6-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="68">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock30MinIntvl5MinSubIntvl</xs:appinfo>
+                     <xs:documentation>30-minute Rolling Block with 5-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="69">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock30MinIntvl3MinSubIntvl</xs:appinfo>
+                     <xs:documentation>30-minute Rolling Block with 3-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="70">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock30MinIntvl2MinSubIntvl</xs:appinfo>
+                     <xs:documentation>30-minute Rolling Block with 2-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="71">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock15MinIntvl5MinSubIntvl</xs:appinfo>
+                     <xs:documentation>15-minute Rolling Block with 5-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="72">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock15MinIntvl3MinSubIntvl</xs:appinfo>
+                     <xs:documentation>15-minute Rolling Block with 3-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="73">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock15MinIntvl1MinSubIntvl</xs:appinfo>
+                     <xs:documentation>15-minute Rolling Block with 1-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="74">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock10MinIntvl5MinSubIntvl</xs:appinfo>
+                     <xs:documentation>10-minute Rolling Block with 5-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="75">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock10MinIntvl2MinSubIntvl</xs:appinfo>
+                     <xs:documentation>10-minute Rolling Block with 2-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="76">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock10MinIntvl1MinSubIntvl</xs:appinfo>
+                     <xs:documentation>10-minute Rolling Block with 1-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="77">
+                  <xs:annotation>
+                     <xs:appinfo>rollingBlock5MinIntvl1MinSubIntvl</xs:appinfo>
+                     <xs:documentation>5-minute Rolling Block with 1-minute sub-intervals</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="TimePeriodOfInterest">
+      <xs:annotation>
+         <xs:documentation>[extension]</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>Not Applicable</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>billingPeriod</xs:appinfo>
+                     <xs:documentation>Captured during the billing period starting at midnight of the first day of the billing period (as defined by the billing cycle day). If during the current billing period, it specifies a period from the start of the current billing period until "now".</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="11">
+                  <xs:annotation>
+                     <xs:appinfo>daily</xs:appinfo>
+                     <xs:documentation>Daily Period starting at midnight. If for the current day, this specifies the time from midnight to "now".</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="13">
+                  <xs:annotation>
+                     <xs:appinfo>monthly</xs:appinfo>
+                     <xs:documentation>Monthly period starting at midnight on the first day of the month. If within the current month, this specifies the period from the start of the month until "now."</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="22">
+                  <xs:annotation>
+                     <xs:appinfo>seasonal</xs:appinfo>
+                     <xs:documentation>A season of time spanning multiple months. E.g. "Summer," "Spring," "Fall," and "Winter" based cycle. If within the current season, it specifies the period from the start of the current season until "now."</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="24">
+                  <xs:annotation>
+                     <xs:appinfo>weekly</xs:appinfo>
+                     <xs:documentation>Weekly period starting at midnight on the first day of the week and ending the instant before midnight the last day of the week. If within the current week, it specifies the period from the start of the week until "now."</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="32">
+                  <xs:annotation>
+                     <xs:appinfo>specifiedPeriod</xs:appinfo>
+                     <xs:documentation>For the period defined by the start and end of the TimePeriod element in the message.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="UnitSymbolKind">
+      <xs:annotation>
+         <xs:documentation>Code for the base unit of measure for Readings of ReadingType.  Used in combination with the powerOfTenMultiplier to specify the actual unit of measure. Valid values per the standard are defined in UomType.
+</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="61">
+                  <xs:annotation>
+                     <xs:appinfo>VA</xs:appinfo>
+                     <xs:documentation>Apparent power, Volt Ampere (See also real power and reactive power.), VA</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="38">
+                  <xs:annotation>
+                     <xs:appinfo>W</xs:appinfo>
+                     <xs:documentation>Real power, Watt. By definition, one Watt equals oneJoule per second. Electrical power may have real and reactive components. The real portion of electrical power (I²R) or VIcos?, is expressed in Watts. (See also apparent power and reactive power.), W</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="63">
+                  <xs:annotation>
+                     <xs:appinfo>VAr</xs:appinfo>
+                     <xs:documentation>Reactive power, Volt Ampere reactive. The “reactive” or “imaginary” component of electrical power (VISin?). (See also real power and apparent power)., VAr</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="71">
+                  <xs:annotation>
+                     <xs:appinfo>VAh</xs:appinfo>
+                     <xs:documentation>Apparent energy, Volt Ampere hours, VAh</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="72">
+                  <xs:annotation>
+                     <xs:appinfo>Wh</xs:appinfo>
+                     <xs:documentation>Real energy, Watt hours, Wh</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="73">
+                  <xs:annotation>
+                     <xs:appinfo>VArh</xs:appinfo>
+                     <xs:documentation>Reactive energy, Volt Ampere reactive hours, VArh</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="29">
+                  <xs:annotation>
+                     <xs:appinfo>V</xs:appinfo>
+                     <xs:documentation>Electric potential, Volt (W/A), V</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="30">
+                  <xs:annotation>
+                     <xs:appinfo>ohm</xs:appinfo>
+                     <xs:documentation>Electric resistance, Ohm (V/A), O</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>A</xs:appinfo>
+                     <xs:documentation>Current, ampere, A</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="25">
+                  <xs:annotation>
+                     <xs:appinfo>F</xs:appinfo>
+                     <xs:documentation>Electric capacitance, Farad (C/V), °C</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="28">
+                  <xs:annotation>
+                     <xs:appinfo>H</xs:appinfo>
+                     <xs:documentation>Electric inductance, Henry (Wb/A), H</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="23">
+                  <xs:annotation>
+                     <xs:appinfo>degC</xs:appinfo>
+                     <xs:documentation>Relative temperature in degrees Celsius. In the SI unit system the symbol is ºC. Electric charge is measured in coulomb that has the unit symbol C. To destinguish degree Celsius form coulomb the symbol used in the UML is degC. Reason for not using ºC is the special character º is difficult to manage in software.</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="27">
+                  <xs:annotation>
+                     <xs:appinfo>sec</xs:appinfo>
+                     <xs:documentation>Time, seconds, s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="159">
+                  <xs:annotation>
+                     <xs:appinfo>min</xs:appinfo>
+                     <xs:documentation>Time, minute = s * 60, min</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="160">
+                  <xs:annotation>
+                     <xs:appinfo>h</xs:appinfo>
+                     <xs:documentation>Time, hour = minute * 60, h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="9">
+                  <xs:annotation>
+                     <xs:appinfo>deg</xs:appinfo>
+                     <xs:documentation>Plane angle, degrees, deg</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="10">
+                  <xs:annotation>
+                     <xs:appinfo>rad</xs:appinfo>
+                     <xs:documentation>Plane angle, Radian (m/m), rad</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="31">
+                  <xs:annotation>
+                     <xs:appinfo>J</xs:appinfo>
+                     <xs:documentation>Energy joule, (N·m = C·V = W·s), J</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="32">
+                  <xs:annotation>
+                     <xs:appinfo>n</xs:appinfo>
+                     <xs:documentation>Force newton, (kg m/s²), N</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="53">
+                  <xs:annotation>
+                     <xs:appinfo>siemens</xs:appinfo>
+                     <xs:documentation>Electric conductance, Siemens (A / V = 1 / O), S</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>none</xs:appinfo>
+                     <xs:documentation>N/A, None</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="33">
+                  <xs:annotation>
+                     <xs:appinfo>Hz</xs:appinfo>
+                     <xs:documentation>Frequency hertz, (1/s), Hz</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>g</xs:appinfo>
+                     <xs:documentation>Mass in gram, g</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="39">
+                  <xs:annotation>
+                     <xs:appinfo>pa</xs:appinfo>
+                     <xs:documentation>Pressure, Pascal (N/m²)(Note: the absolute or relative measurement of pressure is implied with this entry. See below for more explicit forms.), Pa</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>m</xs:appinfo>
+                     <xs:documentation>Length, meter, m</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="41">
+                  <xs:annotation>
+                     <xs:appinfo>m2</xs:appinfo>
+                     <xs:documentation>Area, square meter, m²</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="42">
+                  <xs:annotation>
+                     <xs:appinfo>m3</xs:appinfo>
+                     <xs:documentation>Volume, cubic meter, m³</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="69">
+                  <xs:annotation>
+                     <xs:appinfo>A2</xs:appinfo>
+                     <xs:documentation>Amps squared, amp squared, A2</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="105">
+                  <xs:annotation>
+                     <xs:appinfo>A2h</xs:appinfo>
+                     <xs:documentation>ampere-squared, Ampere-squared hour, A²h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="70">
+                  <xs:annotation>
+                     <xs:appinfo>A2s</xs:appinfo>
+                     <xs:documentation>Amps squared time, square amp second, A²s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="106">
+                  <xs:annotation>
+                     <xs:appinfo>Ah</xs:appinfo>
+                     <xs:documentation>Ampere-hours, Ampere-hours, Ah</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="152">
+                  <xs:annotation>
+                     <xs:appinfo>APerA</xs:appinfo>
+                     <xs:documentation>Current, Ratio of Amperages, A/A</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="103">
+                  <xs:annotation>
+                     <xs:appinfo>aPerM</xs:appinfo>
+                     <xs:documentation>A/m, magnetic field strength, Ampere per metre, A/m</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="68">
+                  <xs:annotation>
+                     <xs:appinfo>As</xs:appinfo>
+                     <xs:documentation>Amp seconds, amp seconds, As</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="79">
+                  <xs:annotation>
+                     <xs:appinfo>b</xs:appinfo>
+                     <xs:documentation>Sound pressure level, Bel, acoustic, Combine with multiplier prefix “d” to form decibels of Sound Pressure Level“dB (SPL).”, B (SPL)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="113">
+                  <xs:annotation>
+                     <xs:appinfo>bm</xs:appinfo>
+                     <xs:documentation>Signal Strength, Bel-mW, normalized to 1mW. Note: to form “dBm” combine “Bm” with multiplier “d”. Bm</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="22">
+                  <xs:annotation>
+                     <xs:appinfo>bq</xs:appinfo>
+                     <xs:documentation>Radioactivity, Becquerel (1/s), Bq</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="132">
+                  <xs:annotation>
+                     <xs:appinfo>btu</xs:appinfo>
+                     <xs:documentation>Energy, British Thermal Units, BTU</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="133">
+                  <xs:annotation>
+                     <xs:appinfo>btuPerH</xs:appinfo>
+                     <xs:documentation>Power, BTU per hour, BTU/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="8">
+                  <xs:annotation>
+                     <xs:appinfo>cd</xs:appinfo>
+                     <xs:documentation>Luminous intensity, candela, cd</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="76">
+                  <xs:annotation>
+                     <xs:appinfo>char</xs:appinfo>
+                     <xs:documentation>Number of characters, characters, char</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="75">
+                  <xs:annotation>
+                     <xs:appinfo>HzPerSec</xs:appinfo>
+                     <xs:documentation>Rate of change of frequency, hertz per second, Hz/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="114">
+                  <xs:annotation>
+                     <xs:appinfo>code</xs:appinfo>
+                     <xs:documentation>Application Value, encoded value, code</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="65">
+                  <xs:annotation>
+                     <xs:appinfo>cosTheta</xs:appinfo>
+                     <xs:documentation>Power factor, Dimensionless <img src="HTS_1.PNG" width="64" height="29" border="0" alt="graphic"/>, cos?</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="111">
+                  <xs:annotation>
+                     <xs:appinfo>count</xs:appinfo>
+                     <xs:documentation>Amount of substance, counter value, count</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="119">
+                  <xs:annotation>
+                     <xs:appinfo>ft3</xs:appinfo>
+                     <xs:documentation>Volume, cubic feet, ft³</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="120">
+                  <xs:annotation>
+                     <xs:appinfo>ft3compensated</xs:appinfo>
+                     <xs:documentation>Volume, cubic feet, ft³(compensated)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="123">
+                  <xs:annotation>
+                     <xs:appinfo>ft3compensatedPerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, compensated cubic feet per hour, ft³(compensated)/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="78">
+                  <xs:annotation>
+                     <xs:appinfo>gM2</xs:appinfo>
+                     <xs:documentation>Turbine inertia, gram·meter2 (Combine with multiplier prefix “k” to form kg·m2.), gm²</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="144">
+                  <xs:annotation>
+                     <xs:appinfo>gPerG</xs:appinfo>
+                     <xs:documentation>Concentration, The ratio of the mass of a solute divided by the mass of the solution., g/g</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="21">
+                  <xs:annotation>
+                     <xs:appinfo>gy</xs:appinfo>
+                     <xs:documentation>Absorbed dose, Gray (J/kg), GY</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="150">
+                  <xs:annotation>
+                     <xs:appinfo>HzPerHz</xs:appinfo>
+                     <xs:documentation>Frequency, Rate of frequency change, Hz/Hz</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="77">
+                  <xs:annotation>
+                     <xs:appinfo>charPerSec</xs:appinfo>
+                     <xs:documentation>Data rate, characters per second, char/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="130">
+                  <xs:annotation>
+                     <xs:appinfo>imperialGal</xs:appinfo>
+                     <xs:documentation>Volume, imperial gallons, ImperialGal</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="131">
+                  <xs:annotation>
+                     <xs:appinfo>imperialGalPerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, Imperial gallons per hour, ImperialGal/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="51">
+                  <xs:annotation>
+                     <xs:appinfo>jPerK</xs:appinfo>
+                     <xs:documentation>Heat capacity, Joule/Kelvin, J/K</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="165">
+                  <xs:annotation>
+                     <xs:appinfo>jPerKg</xs:appinfo>
+                     <xs:documentation>Specific energy, Joules / kg, J/kg</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="6">
+                  <xs:annotation>
+                     <xs:appinfo>K</xs:appinfo>
+                     <xs:documentation>Temperature, Kelvin, K</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="158">
+                  <xs:annotation>
+                     <xs:appinfo>kat</xs:appinfo>
+                     <xs:documentation>Catalytic activity, katal = mol / s, kat</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="47">
+                  <xs:annotation>
+                     <xs:appinfo>kgM</xs:appinfo>
+                     <xs:documentation>Moment of mass ,kilogram meter (kg·m), M</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="48">
+                  <xs:annotation>
+                     <xs:appinfo>kgPerM3</xs:appinfo>
+                     <xs:documentation>Density, gram/cubic meter (combine with prefix multiplier “k” to form kg/ m³), g/m³</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="134">
+                  <xs:annotation>
+                     <xs:appinfo>litre</xs:appinfo>
+                     <xs:documentation>Volume, litre = dm3 = m3/1000., L</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="157">
+                  <xs:annotation>
+                     <xs:appinfo>litreCompensated</xs:appinfo>
+                     <xs:documentation>Volume, litre, with the value compensated for weather effects, L(compensated)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="138">
+                  <xs:annotation>
+                     <xs:appinfo>litreCompensatedPerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, litres (compensated) per hour, L(compensated)/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="137">
+                  <xs:annotation>
+                     <xs:appinfo>litrePerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, litres per hour, L/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="143">
+                  <xs:annotation>
+                     <xs:appinfo>litrePerLitre</xs:appinfo>
+                     <xs:documentation>Concentration, The ratio of the volume of a solute divided by the volume of the solution., L/L</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="82">
+                  <xs:annotation>
+                     <xs:appinfo>litrePerSec</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, Volumetric flow rate, L/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="156">
+                  <xs:annotation>
+                     <xs:appinfo>litreUncompensated</xs:appinfo>
+                     <xs:documentation>Volume, litre, with the value uncompensated for weather effects., L(uncompensated)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="139">
+                  <xs:annotation>
+                     <xs:appinfo>litreUncompensatedPerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, litres (uncompensated) per hour, L(uncompensated)/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="35">
+                  <xs:annotation>
+                     <xs:appinfo>lm</xs:appinfo>
+                     <xs:documentation>Luminous flux, lumen (cd sr), Lm</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="34">
+                  <xs:annotation>
+                     <xs:appinfo>lx</xs:appinfo>
+                     <xs:documentation>Illuminance lux, (lm/m²), L(uncompensated)/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="49">
+                  <xs:annotation>
+                     <xs:appinfo>m2PerSec</xs:appinfo>
+                     <xs:documentation>Viscosity, meter squared / second, m²/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="167">
+                  <xs:annotation>
+                     <xs:appinfo>m3compensated</xs:appinfo>
+                     <xs:documentation>Volume, cubic meter, with the value compensated for weather effects., m3(compensated)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="126">
+                  <xs:annotation>
+                     <xs:appinfo>m3compensatedPerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, compensated cubic meters per hour, ³(compensated)/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="125">
+                  <xs:annotation>
+                     <xs:appinfo>m3PerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, cubic meters per hour, m³/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="45">
+                  <xs:annotation>
+                     <xs:appinfo>m3PerSec</xs:appinfo>
+                     <xs:documentation>m3PerSec, cubic meters per second, m³/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="166">
+                  <xs:annotation>
+                     <xs:appinfo>m3uncompensated</xs:appinfo>
+                     <xs:documentation>m3uncompensated, cubic meter, with the value uncompensated for weather effects., m3(uncompensated)</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="127">
+                  <xs:annotation>
+                     <xs:appinfo>m3uncompensatedPerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, uncompensated cubic meters per hour, m³(uncompensated)/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="118">
+                  <xs:annotation>
+                     <xs:appinfo>meCode</xs:appinfo>
+                     <xs:documentation>EndDeviceEvent, value to be interpreted as a EndDeviceEventCode, meCode</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="7">
+                  <xs:annotation>
+                     <xs:appinfo>mol</xs:appinfo>
+                     <xs:documentation>Amount of substance, mole, mol</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="147">
+                  <xs:annotation>
+                     <xs:appinfo>molPerKg</xs:appinfo>
+                     <xs:documentation>Concentration, Molality, the amount of solute in moles and the amount of solvent in kilograms., mol/kg</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="145">
+                  <xs:annotation>
+                     <xs:appinfo>molPerM3</xs:appinfo>
+                     <xs:documentation>Concentration, The amount of substance concentration, (c), the amount of solvent in moles divided by the volume of solution in m³., mol/ m³</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="146">
+                  <xs:annotation>
+                     <xs:appinfo>molPerMol</xs:appinfo>
+                     <xs:documentation>Concentration, Molar fraction (?), the ratio of the molar amount of a solute divided by the molar amount of the solution.,mol/mol</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="80">
+                  <xs:annotation>
+                     <xs:appinfo>money</xs:appinfo>
+                     <xs:documentation>Monetary unit, Generic money (Note: Specific monetary units are identified the currency class)., ¤</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="148">
+                  <xs:annotation>
+                     <xs:appinfo>mPerM</xs:appinfo>
+                     <xs:documentation>Length, Ratio of length, m/m</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="46">
+                  <xs:annotation>
+                     <xs:appinfo>mPerM3</xs:appinfo>
+                     <xs:documentation>Fuel efficiency, meters / cubic meter, m/m³</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="43">
+                  <xs:annotation>
+                     <xs:appinfo>mPerSec</xs:appinfo>
+                     <xs:documentation>Velocity, meters per second (m/s), m/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="44">
+                  <xs:annotation>
+                     <xs:appinfo>mPerSec2</xs:appinfo>
+                     <xs:documentation>Acceleration, meters per second squared, m/s²</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="102">
+                  <xs:annotation>
+                     <xs:appinfo>ohmM</xs:appinfo>
+                     <xs:documentation>resistivity, ? (rho), ?m</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="155">
+                  <xs:annotation>
+                     <xs:appinfo>paA</xs:appinfo>
+                     <xs:documentation>Pressure, Pascal, absolute pressure, PaA</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="140">
+                  <xs:annotation>
+                     <xs:appinfo>paG</xs:appinfo>
+                     <xs:documentation>Pressure, Pascal, gauge pressure, PaG</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="141">
+                  <xs:annotation>
+                     <xs:appinfo>psiA</xs:appinfo>
+                     <xs:documentation>Pressure, Pounds per square inch, absolute, psiA</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="142">
+                  <xs:annotation>
+                     <xs:appinfo>psiG</xs:appinfo>
+                     <xs:documentation>Pressure, Pounds per square inch, gauge, psiG</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="100">
+                  <xs:annotation>
+                     <xs:appinfo>q</xs:appinfo>
+                     <xs:documentation>Quantity power, Q, Q</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="161">
+                  <xs:annotation>
+                     <xs:appinfo>q45</xs:appinfo>
+                     <xs:documentation>Quantity power, Q measured at 45º, Q45</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="163">
+                  <xs:annotation>
+                     <xs:appinfo>q45h</xs:appinfo>
+                     <xs:documentation>Quantity energy, Q measured at 45º, Q45h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="162">
+                  <xs:annotation>
+                     <xs:appinfo>q60</xs:appinfo>
+                     <xs:documentation>Quantity power, Q measured at 60º, Q60</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="164">
+                  <xs:annotation>
+                     <xs:appinfo>q60h</xs:appinfo>
+                     <xs:documentation>Quantity energy, Qh measured at 60º, Q60h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="101">
+                  <xs:annotation>
+                     <xs:appinfo>qh</xs:appinfo>
+                     <xs:documentation>Quantity energy, Qh, Qh</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="54">
+                  <xs:annotation>
+                     <xs:appinfo>radPerSec</xs:appinfo>
+                     <xs:documentation>Angular velocity, radians per second, rad/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="154">
+                  <xs:annotation>
+                     <xs:appinfo>rev</xs:appinfo>
+                     <xs:documentation>Amount of rotation, Revolutions, rev</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>revPerSec</xs:appinfo>
+                     <xs:documentation>Rotational speed, Rotations per second, rev/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="149">
+                  <xs:annotation>
+                     <xs:appinfo>secPerSec</xs:appinfo>
+                     <xs:documentation>Time, Ratio of time (can be combined with an multiplier prefix to show rates such as a clock drift rate, e.g. “µs/s”), s/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="11">
+                  <xs:annotation>
+                     <xs:appinfo>sr</xs:appinfo>
+                     <xs:documentation>Solid angle, Steradian (m2/m2), sr</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="109">
+                  <xs:annotation>
+                     <xs:appinfo>status</xs:appinfo>
+                     <xs:documentation>State, "1" = "true", "live", "on", "high", "set"; "0" = "false", "dead", "off", "low", "cleared"Note: A Boolean value is preferred but other values may be supported, status</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="24">
+                  <xs:annotation>
+                     <xs:appinfo>sv</xs:appinfo>
+                     <xs:documentation>Doe equivalent, Sievert (J/kg), Sv</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="37">
+                  <xs:annotation>
+                     <xs:appinfo>t</xs:appinfo>
+                     <xs:documentation>Magnetic flux density, Tesla (Wb/m2), T</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="169">
+                  <xs:annotation>
+                     <xs:appinfo>therm</xs:appinfo>
+                     <xs:documentation>Energy, Therm, therm</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="108">
+                  <xs:annotation>
+                     <xs:appinfo>timeStamp</xs:appinfo>
+                     <xs:documentation>Timestamp, time and date per ISO 8601 format, timeStamp</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="128">
+                  <xs:annotation>
+                     <xs:appinfo>usGal</xs:appinfo>
+                     <xs:documentation>Volume, US gallons, Gal</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="129">
+                  <xs:annotation>
+                     <xs:appinfo>usGalPerH</xs:appinfo>
+                     <xs:documentation>Volumetric flow rate, US gallons per hour, USGal/h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="67">
+                  <xs:annotation>
+                     <xs:appinfo>V2</xs:appinfo>
+                     <xs:documentation>Volts squared, Volt squared (W2/A2), V²</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="104">
+                  <xs:annotation>
+                     <xs:appinfo>V2h</xs:appinfo>
+                     <xs:documentation>volt-squared hour, Volt-squared-hours, V²h</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="117">
+                  <xs:annotation>
+                     <xs:appinfo>VAhPerRev</xs:appinfo>
+                     <xs:documentation>Kh-Vah, apparent energy metering constant, VAh/rev</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="116">
+                  <xs:annotation>
+                     <xs:appinfo>VArhPerRev</xs:appinfo>
+                     <xs:documentation>Kh-VArh, reactive energy metering constant, VArh/rev</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="74">
+                  <xs:annotation>
+                     <xs:appinfo>VPerHz</xs:appinfo>
+                     <xs:documentation>Magnetic flux, Volts per Hertz, V/Hz</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="151">
+                  <xs:annotation>
+                     <xs:appinfo>VPerV</xs:appinfo>
+                     <xs:documentation>Voltage, Ratio of voltages (e.g. mV/V), V/V</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="66">
+                  <xs:annotation>
+                     <xs:appinfo>Vs</xs:appinfo>
+                     <xs:documentation>Volt seconds, Volt seconds (Ws/A), Vs</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="36">
+                  <xs:annotation>
+                     <xs:appinfo>wb</xs:appinfo>
+                     <xs:documentation>Magnetic flux, Weber (V s), Wb</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="107">
+                  <xs:annotation>
+                     <xs:appinfo>WhPerM3</xs:appinfo>
+                     <xs:documentation>Wh/m3, energy per volume, Wh/m³</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="115">
+                  <xs:annotation>
+                     <xs:appinfo>WhPerRev</xs:appinfo>
+                     <xs:documentation>Kh-Wh, active energy metering constant, Wh/rev</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="50">
+                  <xs:annotation>
+                     <xs:appinfo>wPerMK</xs:appinfo>
+                     <xs:documentation>Thermal conductivity, Watt/meter Kelvin, W/m K</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="81">
+                  <xs:annotation>
+                     <xs:appinfo>WPerSec</xs:appinfo>
+                     <xs:documentation>Ramp rate, Watts per second, W/s</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="153">
+                  <xs:annotation>
+                     <xs:appinfo>WPerVA</xs:appinfo>
+                     <xs:documentation>Power Factor, PF, W/VA</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="168">
+                  <xs:annotation>
+                     <xs:appinfo>WPerW</xs:appinfo>
+                     <xs:documentation>Signal Strength, Ratio of power, W/W</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="StatusCode">
+      <xs:annotation>
+         <xs:documentation>indicates the status code of the associated transaction</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="200">
+                  <xs:annotation>
+                     <xs:appinfo>Ok</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="201">
+                  <xs:annotation>
+                     <xs:appinfo>Created</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="204">
+                  <xs:annotation>
+                     <xs:appinfo>No Content</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="301">
+                  <xs:annotation>
+                     <xs:appinfo>Moved Permanently</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="302">
+                  <xs:annotation>
+                     <xs:appinfo>Redirect</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="304">
+                  <xs:annotation>
+                     <xs:appinfo>Not Modified</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="400">
+                  <xs:annotation>
+                     <xs:appinfo>Bad Request</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="401">
+                  <xs:annotation>
+                     <xs:appinfo>Unauthorized</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="403">
+                  <xs:annotation>
+                     <xs:appinfo>Forbidden</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="404">
+                  <xs:annotation>
+                     <xs:appinfo>Not Found</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="405">
+                  <xs:annotation>
+                     <xs:appinfo>Method Not Allowed</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="410">
+                  <xs:annotation>
+                     <xs:appinfo>Gone</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="500">
+                  <xs:annotation>
+                     <xs:appinfo>Internal Server Error</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="CRUDOperation">
+      <xs:annotation>
+         <xs:documentation>Specifies the operation requrested of this item</xs:documentation>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>Create</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>Read</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>Update</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>Delete</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="DataCustodianApplicationStatus">
+      <xs:annotation>
+         <xs:documentation/>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>Review</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>Production (Live)</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>On Hold</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>Revoked</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="ThirdPartyApplicatonStatus">
+      <xs:annotation>
+         <xs:documentation/>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>Development</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>ReviewTest</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>Production</xs:appinfo>
+                     <xs:documentation>Live</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>Retired</xs:appinfo>
+                     <xs:documentation>Remove</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="ThirdPartyApplicationType">
+      <xs:annotation>
+         <xs:documentation/>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>Web</xs:appinfo>
+                     <xs:documentation>The application is on the web</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>Desktop</xs:appinfo>
+                     <xs:documentation>The application is on a desktop</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>Mobile</xs:appinfo>
+                     <xs:documentation>The application is on a mobil device</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>Device</xs:appinfo>
+                     <xs:documentation>The application is on another device</xs:documentation>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="ThirdPartyApplicationUse">
+      <xs:annotation>
+         <xs:documentation/>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>EnergyManagement</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="2">
+                  <xs:annotation>
+                     <xs:appinfo>Comparisons</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="3">
+                  <xs:annotation>
+                     <xs:appinfo>Government</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="4">
+                  <xs:annotation>
+                     <xs:appinfo>Academic</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="5">
+                  <xs:annotation>
+                     <xs:appinfo>LawEnforcement</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="AuthorizationStatus">
+      <xs:annotation>
+         <xs:documentation/>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>Revoked</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>Active</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="ESPIServiceStatus">
+      <xs:annotation>
+         <xs:documentation/>
+      </xs:annotation>
+      <xs:union memberTypes="UInt16">
+         <xs:simpleType>
+            <xs:restriction base="UInt16">
+               <xs:enumeration value="0">
+                  <xs:annotation>
+                     <xs:appinfo>Unavailable</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+               <xs:enumeration value="1">
+                  <xs:annotation>
+                     <xs:appinfo>Normal</xs:appinfo>
+                     <xs:documentation/>
+                  </xs:annotation>
+               </xs:enumeration>
+            </xs:restriction>
+         </xs:simpleType>
+      </xs:union>
+   </xs:simpleType>
+   <xs:simpleType name="DstRuleType">
+      <xs:annotation>
+         <xs:documentation>[extension] Bit map encoded rule from which is calculated the start or end time, within the current year, to which daylight savings time offset must be applied. 
+
+The rule encoding:
+Bits  0 - 11: seconds 0 - 3599
+Bits 12 - 16: hours 0 - 23
+Bits 17 - 19: day of the week 0 = not applicable, 1 - 7 (Monday = 1)
+Bits:20 - 24: day of the month 0 = not applicable, 1 - 31
+Bits: 25 - 27: operator  (detailed below)
+Bits: 28 - 31: month 1 - 12
+
+Rule value of 0xFFFFFFFF means rule processing/DST correction is disabled.
+
+The operators:
+
+0: DST starts/ends on the Day of the Month
+1: DST starts/ends on the Day of the Week that is on or after the Day of the Month
+2: DST starts/ends on the first occurrence of the Day of the Week in a month
+3: DST starts/ends on the second occurrence of the Day of the Week in a month
+4: DST starts/ends on the third occurrence of the Day of the Week in a month
+5: DST starts/ends on the forth occurrence of the Day of the Week in a month
+6: DST starts/ends on the fifth occurrence of the Day of the Week in a month
+7: DST starts/ends on the last occurrence of the Day of the Week in a month
+
+An example: DST starts on third Friday in March at 1:45 AM.  The rule...
+Seconds: 2700
+Hours: 1
+Day of Week: 5
+Day of Month: 0
+Operator: 4
+Month: 3</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="HexBinary32"/>
+   </xs:simpleType>
+   <!--
+=======================================
+Global Elements
+=======================================
+-->
+   <xs:element name="IntervalBlock" type="IntervalBlock"/>
+   <xs:element name="IntervalReading" type="IntervalReading"/>
+   <xs:element name="MeterReading" type="MeterReading"/>
+   <xs:element name="ReadingQuality" type="ReadingQuality"/>
+   <xs:element name="ReadingType" type="ReadingType"/>
+   <xs:element name="IdentifiedObject" type="IdentifiedObject"/>
+   <xs:element name="UsagePoint" type="UsagePoint"/>
+   <xs:element name="ElectricPowerQualitySummary" type="ElectricPowerQualitySummary"/>
+   <xs:element name="ElectricPowerUsageSummary" type="ElectricPowerUsageSummary"/>
+   <xs:element name="DateTimeInterval" type="DateTimeInterval"/>
+   <xs:element name="SummaryMeasurement" type="SummaryMeasurement"/>
+   <xs:element name="BatchItemInfo" type="BatchItemInfo"/>
+   <xs:element name="Object" type="Object"/>
+   <xs:element name="ServiceStatus" type="ServiceStatus"/>
+   <xs:element name="LocalTimeParameters" type="TimeConfiguration"/>
+</xs:schema>

+ 260 - 0
schema/oadr_power_20b.xsd

@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- edited with XMLSpy v2011 rel. 2 sp1 (http://www.altova.com) by Paul Lipkin (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:power="http://docs.oasis-open.org/ns/emix/2011/06/power" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:scale="http://docs.oasis-open.org/ns/emix/2011/06/siscale" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" targetNamespace="http://docs.oasis-open.org/ns/emix/2011/06/power" elementFormDefault="qualified" attributeFormDefault="qualified">
+	<xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="oadr_gml_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06" schemaLocation="oadr_emix_20b.xsd"/>
+	<xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06/siscale" schemaLocation="oadr_siscale_20b.xsd"/>
+	<xs:element name="endDeviceAsset" type="power:EndDeviceAssetType"/>
+	<xs:complexType name="EndDeviceAssetType">
+		<xs:annotation>
+			<xs:documentation>The EndDeviceAssets are the physical device or devices which could be meters or other types of devices that may be of interest</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="power:mrid"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- 9.8.1.1 Meters -->
+	<xs:element name="meterAsset" type="power:MeterAssetType"/>
+	<xs:complexType name="MeterAssetType">
+		<xs:annotation>
+			<xs:documentation>The MeterAsset is the physical device or devices that performs the role of the meter</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="power:mrid"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- 9.8.2 Nodes -->
+	<xs:element name="pnode" type="power:PnodeType"/>
+	<xs:complexType name="PnodeType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>A pricing node is directly associated with a connectivity node.  It is a pricing location for which market participants submit their bids, offers, buy/sell CRRs, and settle.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="power:node"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:element name="aggregatedPnode" type="power:AggregatedPnodeType"/>
+	<xs:complexType name="AggregatedPnodeType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>An aggregated pricing node is a specialized type of pricing node used to model items such as System Zone, Default Price Zone, Custom Price Zone, Control Area, Aggregated Generation, Aggregated Participating Load, Aggregated Non-Participating Load, Trading Hub, DCA Zone</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="power:node"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:element name="serviceLocation" type="power:ServiceLocationType"/>
+	<xs:complexType name="ServiceLocationType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>A customer ServiceLocation has one or more ServiceDeliveryPoint(s), which in turn relate to Meters. The location may be a point or a polygon, depending on the specific circumstances. For distribution, the ServiceLocation is typically the location of the utility customer's premise. </xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="gml:FeatureCollection"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:element name="serviceDeliveryPoint" type="power:ServiceDeliveryPointType"/>
+	<xs:complexType name="ServiceDeliveryPointType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Logical point on the network where the ownership of the service changes hands. It is one of potentially many service points within a ServiceLocation, delivering service in accordance with a CustomerAgreement. Used at the place where a meter may be installed.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element ref="power:node"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- 9.8.3 Transport Interface -->
+	<xs:element name="transportInterface" type="power:TransportInterfaceType"/>
+	<xs:complexType name="TransportInterfaceType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>The Transport Interface delineates the edges at either end of a transport segment.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="pointOfReceipt" type="power:NodeType"/>
+			<xs:element name="pointOfDelivery" type="power:NodeType"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- 9.8.9 Base Elements for Interfaces -->
+	<xs:element name="node" type="power:NodeType"/>
+	<xs:simpleType name="NodeType">
+		<xs:annotation>
+			<xs:documentation>The Node is a place where something changes (often ownership) or connects on the grid. Many nodes are associated with meters, but not all are.</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string"/>
+	</xs:simpleType>
+	<!-- 9.8.9.1 Base Elements for Interfaces -->
+	<!--	The identifier for a EndDevice (meter or other), is mRID from IEC61968-->
+	<xs:element name="mrid" type="power:MridType"/>
+	<xs:simpleType name="MridType">
+		<xs:annotation>
+			<xs:documentation>The mRID identifies the physical device that may be a CustomerMeter or other types of EndDevices.</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string"/>
+	</xs:simpleType>
+	<!--  9.9.1 Voltage   -->
+	<xs:element name="voltage" type="power:VoltageType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="VoltageType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Voltage</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="Voltage"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="V"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- 9.9.2 Energy Units -->
+	<xs:element name="energyApparent" type="power:EnergyApparentType" substitutionGroup="power:energyItem"/>
+	<xs:complexType name="EnergyApparentType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Apparent Energy, measured in volt-ampere hours (VAh)</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:restriction base="power:EnergyItemType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="ApparentEnergy"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="VAh"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:element name="energyReactive" type="power:EnergyReactiveType" substitutionGroup="power:energyItem"/>
+	<xs:complexType name="EnergyReactiveType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Reactive Energy, volt-amperes reactive hours (VARh)</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:restriction base="power:EnergyItemType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="ReactiveEnergy"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="VARh"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:element name="energyReal" type="power:EnergyRealType" substitutionGroup="power:energyItem"/>
+	<xs:complexType name="EnergyRealType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Real Energy, Watt Hours (Wh)</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:restriction base="power:EnergyItemType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="RealEnergy"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="Wh"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- ==================================================== -->
+	<!-- 9.9.5 Base Energy Item Type -->
+	<!-- ==================================================== -->
+	<xs:element name="energyItem" type="power:EnergyItemType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="EnergyItemType" abstract="true" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Base for the measurement of Energy</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string"/>
+					<xs:element name="itemUnits" type="xs:string"/>
+					<xs:element ref="scale:siScaleCode"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- ==================================================== -->
+	<!-- 9.9.4 Power Units -->
+	<!-- ==================================================== -->
+	<!-- ==================================================== -->
+	<xs:element name="powerApparent" type="power:PowerApparentType" substitutionGroup="power:powerItem"/>
+	<xs:complexType name="PowerApparentType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Apparent Power measured in volt-amperes (VA)</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:restriction base="power:PowerItemType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="ApparentPower"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="VA"/>
+					<xs:element ref="scale:siScaleCode"/>
+					<xs:element ref="power:powerAttributes"/>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- ==================================================== -->
+	<xs:element name="powerReactive" type="power:PowerReactiveType" substitutionGroup="power:powerItem"/>
+	<xs:complexType name="PowerReactiveType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Reactive power, measured in volt-amperes reactive (VAR)</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:restriction base="power:PowerItemType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="ReactivePower"/>
+					<xs:element name="itemUnits" type="xs:string" fixed="VAR"/>
+					<xs:element ref="scale:siScaleCode"/>
+					<xs:element ref="power:powerAttributes"/>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- ==================================================== -->
+	<xs:element name="powerReal" type="power:PowerRealType" substitutionGroup="power:powerItem"/>
+	<xs:complexType name="PowerRealType" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Real power measured in Watts (W) or Joules/second (J/s)</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:restriction base="power:PowerItemType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string" fixed="RealPower"/>
+					<xs:element name="itemUnits">
+						<xs:simpleType>
+							<xs:restriction base="xs:token">
+								<xs:enumeration value="W"/>
+								<xs:enumeration value="J/s"/>
+							</xs:restriction>
+						</xs:simpleType>
+					</xs:element>
+					<xs:element ref="scale:siScaleCode"/>
+					<xs:element ref="power:powerAttributes"/>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- ==================================================== -->
+	<!-- 9.9.5 Base Power Item Type -->
+	<!-- ==================================================== -->
+	<xs:element name="powerItem" type="power:PowerItemType" substitutionGroup="emix:itemBase"/>
+	<xs:complexType name="PowerItemType" abstract="true" mixed="false">
+		<xs:annotation>
+			<xs:documentation>Base for the measurement of Power</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="false">
+			<xs:extension base="emix:ItemBaseType">
+				<xs:sequence>
+					<xs:element name="itemDescription" type="xs:string"/>
+					<xs:element name="itemUnits" type="xs:string"/>
+					<xs:element ref="scale:siScaleCode"/>
+					<xs:element ref="power:powerAttributes"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- ==================================================== -->
+	<xs:element name="powerAttributes" type="power:PowerAttributesType"/>
+	<xs:complexType name="PowerAttributesType">
+		<xs:sequence>
+			<xs:element name="hertz" type="xs:decimal"/>
+			<xs:element name="voltage" type="xs:decimal"/>
+			<xs:element name="ac" type="xs:boolean"/>
+		</xs:sequence>
+	</xs:complexType>
+</xs:schema>

+ 52 - 0
schema/oadr_pyld_20b.xsd

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- edited with XMLSpy v2010 rel. 3 (http://www.altova.com) by James Zuber (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:pyld="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" targetNamespace="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" elementFormDefault="qualified" attributeFormDefault="qualified">
+   <xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06" schemaLocation="oadr_emix_20b.xsd"/>
+   <xs:import namespace="http://docs.oasis-open.org/ns/energyinterop/201110" schemaLocation="oadr_ei_20b.xsd"/>
+   <!-- ##### SAME AS A #####-->
+   <!-- ##### EVENT PAYLOADS ##### -->
+   <!--  ******* requestID ******** -->
+   <xs:element name="requestID" type="xs:string">
+      <xs:annotation>
+         <xs:documentation>A ID used to match up a logical transaction request and response</xs:documentation>
+      </xs:annotation>
+   </xs:element>
+   <!--  ******* replyLimit ******** -->
+   <xs:element name="replyLimit" type="xs:unsignedInt"/>
+   <!--  *******eiRequestEvent******** -->
+   <xs:element name="eiRequestEvent">
+      <xs:annotation>
+         <xs:documentation>Request Event from a VTN in pull mode</xs:documentation>
+      </xs:annotation>
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element ref="pyld:requestID"/>
+            <xs:element ref="ei:venID"/>
+            <xs:element ref="pyld:replyLimit" minOccurs="0">
+               <xs:annotation>
+                  <xs:documentation>Limit the number of events contained in the oadrDistributeEvent payload</xs:documentation>
+               </xs:annotation>
+            </xs:element>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+   <!--  ******* eiCreatedEvent ******** -->
+   <xs:element name="eiCreatedEvent">
+      <xs:annotation>
+         <xs:documentation>Respond to a DR Event with optIn or optOut</xs:documentation>
+      </xs:annotation>
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element ref="ei:eiResponse"/>
+            <xs:element ref="ei:eventResponses" minOccurs="0"/>
+            <xs:element ref="ei:venID"/>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+   <!-- ##### PROFILE B EXTENTIONS ##### -->
+   <xs:element name="reportToFollow" type="xs:boolean">
+      <xs:annotation>
+         <xs:documentation>Indicates if report (in the form of UpdateReport) to be returned following cancellation of Report</xs:documentation>
+      </xs:annotation>
+   </xs:element>
+</xs:schema>

+ 106 - 0
schema/oadr_siscale_20b.xsd

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+     Energy Market Information Exchange (EMIX) Version 1.0
+     Committee Specification Draft 04 / Public Review 04
+     08 September 2011
+     Copyright (c) OASIS Open 2011.  All Rights Reserved.
+     Source: http://docs.oasis-open.org/emix/emix/v1.0/csprd04/xsd/
+-->
+<!-- ====================================================================== -->
+<!-- ===== SI Scale Code List  Schema Module                     ===== -->
+<!-- ====================================================================== -->
+<!--
+Schema agency:    OASIS EMIX TC
+Schema version:    1.0
+Schema date:          7 September 2011
+Purpose:                Enumerates scale factors for Units based on the International System of Units (SI) (originally Le Système International d'Unités)
+
+It would be well if there were a common non-emix genericode Si Scale schema to refer to for this, but the editor is aware of none.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:scale="http://docs.oasis-open.org/ns/emix/2011/06/siscale" targetNamespace="http://docs.oasis-open.org/ns/emix/2011/06/siscale" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+   <!-- ======================================================================= -->
+   <!-- ===== Element Declarations                                        ===== -->
+   <!-- ======================================================================= -->
+   <!-- ===== Root Element                                                ===== -->
+   <!-- ======================================================================= -->
+   <xs:element name="siScaleCode" type="scale:SiScaleCodeType"/>
+   <!-- ================================================================== -->
+   <!-- ===== Type Definitions                                       ===== -->
+   <!-- ================================================================== -->
+   <!-- ===== Type Definition: ISO 3 alpha currency code Content Type ===== -->
+   <!-- ================================================================== -->
+   <xs:simpleType name="SiScaleCodeType">
+      <xs:annotation>
+         <xs:documentation>Scale based on representations of SI scale as expressed in the unit multipliers</xs:documentation>
+         <xs:documentation xml:lang="en">enumeration</xs:documentation>
+      </xs:annotation>
+      <xs:restriction base="xs:string">
+         <xs:enumeration value="p">
+            <xs:annotation>
+               <xs:documentation>Pico 10**-12</xs:documentation>
+               <xs:appinfo>-12</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="n">
+            <xs:annotation>
+               <xs:documentation>Nano 10**-9</xs:documentation>
+               <xs:appinfo>-9</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="micro">
+            <xs:annotation>
+               <xs:documentation>Micro 10**-6</xs:documentation>
+               <xs:appinfo>-6</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="m">
+            <xs:annotation>
+               <xs:documentation>Milli 10**-3</xs:documentation>
+               <xs:appinfo>-3</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="c">
+            <xs:annotation>
+               <xs:documentation>Centi 10**-2</xs:documentation>
+               <xs:appinfo>-2</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="d">
+            <xs:annotation>
+               <xs:documentation>Deci 10**-1</xs:documentation>
+               <xs:appinfo>-1</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="k">
+            <xs:annotation>
+               <xs:documentation>Kilo 10**3</xs:documentation>
+               <xs:appinfo>3</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="M">
+            <xs:annotation>
+               <xs:documentation>Mega 10**6</xs:documentation>
+               <xs:appinfo>6</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="G">
+            <xs:annotation>
+               <xs:documentation>Giga 10**9</xs:documentation>
+               <xs:appinfo>9</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="T">
+            <xs:annotation>
+               <xs:documentation>Tera 10**12</xs:documentation>
+               <xs:appinfo>12</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+         <xs:enumeration value="none">
+            <xs:annotation>
+               <xs:documentation>Native Scale</xs:documentation>
+               <xs:appinfo>0</xs:appinfo>
+            </xs:annotation>
+         </xs:enumeration>
+      </xs:restriction>
+   </xs:simpleType>
+</xs:schema>

+ 36 - 0
schema/oadr_strm_20b.xsd

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- edited with XMLSpy v2010 rel. 3 (http://www.altova.com) by James Zuber (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:strm="urn:ietf:params:xml:ns:icalendar-2.0:stream" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" targetNamespace="urn:ietf:params:xml:ns:icalendar-2.0:stream" elementFormDefault="qualified" attributeFormDefault="qualified">
+   <xs:import namespace="urn:ietf:params:xml:ns:icalendar-2.0" schemaLocation="oadr_xcal_20b.xsd"/>
+   <xs:import namespace="http://docs.oasis-open.org/ns/energyinterop/201110" schemaLocation="oadr_ei_20b.xsd"/>
+   <!-- ##### SAME AS A #####-->
+   <!--  ******* intervals ******** -->
+   <xs:element name="intervals">
+      <xs:annotation>
+         <xs:documentation>Time intervals during which the DR event is active or report data is available</xs:documentation>
+      </xs:annotation>
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element ref="ei:interval" maxOccurs="unbounded"/>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+   <xs:element name="streamPayloadBase" type="strm:StreamPayloadBaseType" abstract="true"/>
+   <xs:complexType name="StreamPayloadBaseType" abstract="true">
+      <xs:annotation>
+         <xs:documentation>Abstract class to convey a payload for a stream. When a Stream is transformed to or from a WS-Calendar Interval, the contents of the Stream Payload defined element are transformed into the contents of a WS-Calendar artifactBase.</xs:documentation>
+      </xs:annotation>
+   </xs:complexType>
+   <!-- 1.0 Abstract Stream Base -->
+   <xs:element name="streamBase" type="strm:StreamBaseType" abstract="true"/>
+   <xs:complexType name="StreamBaseType" abstract="true">
+      <xs:annotation>
+         <xs:documentation>abstract base for communication of schedules for signals and observations</xs:documentation>
+      </xs:annotation>
+      <xs:sequence>
+         <xs:element ref="xcal:dtstart" minOccurs="0"/>
+         <xs:element ref="xcal:duration" minOccurs="0"/>
+         <xs:element ref="strm:intervals" minOccurs="0"/>
+      </xs:sequence>
+   </xs:complexType>
+</xs:schema>

+ 129 - 0
schema/oadr_xcal_20b.xsd

@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- edited with XMLSpy v2010 rel. 3 (http://www.altova.com) by James Zuber (private) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110" targetNamespace="urn:ietf:params:xml:ns:icalendar-2.0" elementFormDefault="qualified" attributeFormDefault="qualified">
+   <xs:import namespace="http://docs.oasis-open.org/ns/energyinterop/201110" schemaLocation="oadr_ei_20b.xsd"/>
+   <!-- ##### SAME AS A ##### -->
+   <!--  ******* date-time ******** -->
+   <xs:element name="date-time" type="xcal:DateTimeType"/>
+   <!--  ******* DateTimeType ******** -->
+   <xs:simpleType name="DateTimeType">
+      <xs:restriction base="xs:dateTime">
+         <xs:pattern value="(\-|\+)?\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}(\.\d*)?Z?"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <!--  ******* duration ******** -->
+   <xs:element name="duration" type="xcal:DurationPropType">
+      <xs:annotation>
+         <xs:documentation>The duration of the  activity, data, or state </xs:documentation>
+      </xs:annotation>
+   </xs:element>
+   <!--  ******* DurationPropType ******** -->
+   <xs:complexType name="DurationPropType" mixed="false">
+      <xs:sequence>
+         <xs:element name="duration" type="xcal:DurationValueType"/>
+      </xs:sequence>
+   </xs:complexType>
+   <!--  ******* DurationValueType ******** -->
+   <xs:simpleType name="DurationValueType">
+      <xs:restriction base="xs:string">
+         <xs:pattern value="(\+|\-)?P((\d+Y)?(\d+M)?(\d+D)?T?(\d+H)?(\d+M)?(\d+S)?)|(\d+W)"/>
+      </xs:restriction>
+   </xs:simpleType>
+   <!--  ******* uid ******** -->
+   <xs:element name="uid">
+      <xs:annotation>
+         <xs:documentation>Used as an index to identify intervals</xs:documentation>
+      </xs:annotation>
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element ref="xcal:text"/>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+   <!--  ******* text ******** -->
+   <xs:element name="text" type="xs:string"/>
+   <xs:element name="dtstart">
+      <xs:annotation>
+         <xs:documentation>The starting time for the activity, data, or state change</xs:documentation>
+      </xs:annotation>
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element ref="xcal:date-time"/>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+   <!--  ******* properties ******** -->
+   <xs:element name="properties">
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element ref="xcal:dtstart"/>
+            <xs:element ref="xcal:duration"/>
+            <xs:element name="tolerance" minOccurs="0">
+               <xs:annotation>
+                  <xs:documentation>Set randomization period for start of event</xs:documentation>
+               </xs:annotation>
+               <xs:complexType>
+                  <xs:sequence>
+                     <xs:element name="tolerate">
+                        <xs:complexType>
+                           <xs:sequence>
+                              <xs:element name="startafter" type="xcal:DurationValueType" minOccurs="0"/>
+                           </xs:sequence>
+                        </xs:complexType>
+                     </xs:element>
+                  </xs:sequence>
+               </xs:complexType>
+            </xs:element>
+            <xs:element ref="ei:x-eiNotification" minOccurs="0"/>
+            <xs:element ref="ei:x-eiRampUp" minOccurs="0"/>
+            <xs:element ref="ei:x-eiRecovery" minOccurs="0"/>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+   <!--  ******* components ******** -->
+   <xs:element name="components" nillable="true"/>
+   <!-- ##### NEW for B ##### -->
+   <!--  ******* dtend ******** -->
+   <xs:element name="dtend">
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element ref="xcal:date-time"/>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+   <!-- ******* vavailabiity ******** -->
+   <xs:complexType name="VavailabilityType" mixed="false">
+      <xs:sequence>
+         <xs:element name="components" type="xcal:ArrayOfVavailabilityContainedComponents"/>
+      </xs:sequence>
+   </xs:complexType>
+   <xs:element name="vavailability" type="xcal:VavailabilityType">
+      <xs:annotation>
+         <xs:documentation>A schedule reflecting device availability for participating in DR events</xs:documentation>
+      </xs:annotation>
+   </xs:element>
+   <xs:complexType name="ArrayOfVavailabilityContainedComponents">
+      <xs:sequence>
+         <xs:element ref="xcal:available" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+   </xs:complexType>
+   <xs:complexType name="AvailableType" mixed="false">
+      <xs:sequence>
+         <xs:element ref="xcal:properties"/>
+      </xs:sequence>
+   </xs:complexType>
+   <xs:element name="available" type="xcal:AvailableType"/>
+   <!-- Granularity is used in the VAVAILABILITY and AVAILABILITY components -->
+   <xs:element name="granularity" type="xcal:DurationPropType"/>
+   <xs:element name="interval" type="xcal:WsCalendarIntervalType"/>
+   <xs:complexType name="WsCalendarIntervalType">
+      <xs:annotation>
+         <xs:documentation xml:lang="en">
+			 An interval takes no sub-components.
+			 </xs:documentation>
+      </xs:annotation>
+      <xs:sequence>
+         <xs:element ref="xcal:properties"/>
+      </xs:sequence>
+   </xs:complexType>
+</xs:schema>

+ 108 - 0
schema/oadr_xml.xsd

@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="http://www.w3.org/XML/1998/namespace" xml:lang="en">
+	<xs:annotation>
+		<xs:documentation>
+   See http://www.w3.org/XML/1998/namespace.html and
+   http://www.w3.org/TR/REC-xml for information about this namespace.
+
+    This schema document describes the XML namespace, in a form
+    suitable for import by other schema documents.  
+
+    Note that local names in this namespace are intended to be defined
+    only by the World Wide Web Consortium or its subgroups.  The
+    following names are currently defined in this namespace and should
+    not be used with conflicting semantics by any Working Group,
+    specification, or document instance:
+
+    base (as an attribute name): denotes an attribute whose value
+         provides a URI to be used as the base for interpreting any
+         relative URIs in the scope of the element on which it
+         appears; its value is inherited.  This name is reserved
+         by virtue of its definition in the XML Base specification.
+
+    lang (as an attribute name): denotes an attribute whose value
+         is a language code for the natural language of the content of
+         any element; its value is inherited.  This name is reserved
+         by virtue of its definition in the XML specification.
+  
+    space (as an attribute name): denotes an attribute whose
+         value is a keyword indicating what whitespace processing
+         discipline is intended for the content of the element; its
+         value is inherited.  This name is reserved by virtue of its
+         definition in the XML specification.
+
+    Father (in any context at all): denotes Jon Bosak, the chair of 
+         the original XML Working Group.  This name is reserved by 
+         the following decision of the W3C XML Plenary and 
+         XML Coordination groups:
+
+             In appreciation for his vision, leadership and dedication
+             the W3C XML Plenary on this 10th day of February, 2000
+             reserves for Jon Bosak in perpetuity the XML name
+             xml:Father
+  </xs:documentation>
+	</xs:annotation>
+	<xs:annotation>
+		<xs:documentation>This schema defines attributes and an attribute group
+        suitable for use by
+        schemas wishing to allow xml:base, xml:lang or xml:space attributes
+        on elements they define.
+
+        To enable this, such a schema must import this schema
+        for the XML namespace, e.g. as follows:
+        &lt;schema . . .>
+         . . .
+         &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                    schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
+
+        Subsequently, qualified reference to any of the attributes
+        or the group defined below will have the desired effect, e.g.
+
+        &lt;type . . .>
+         . . .
+         &lt;attributeGroup ref="xml:specialAttrs"/>
+ 
+         will define a type which will schema-validate an instance
+         element with any of those attributes</xs:documentation>
+	</xs:annotation>
+	<xs:annotation>
+		<xs:documentation>In keeping with the XML Schema WG's standard versioning
+   policy, this schema document will persist at
+   http://www.w3.org/2001/03/xml.xsd.
+   At the date of issue it can also be found at
+   http://www.w3.org/2001/xml.xsd.
+   The schema document at that URI may however change in the future,
+   in order to remain compatible with the latest version of XML Schema
+   itself.  In other words, if the XML Schema namespace changes, the version
+   of this document at
+   http://www.w3.org/2001/xml.xsd will change
+   accordingly; the version at
+   http://www.w3.org/2001/03/xml.xsd will not change.
+  </xs:documentation>
+	</xs:annotation>
+	<xs:attribute name="lang" type="xs:language">
+		<xs:annotation>
+			<xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter
+         codes as the enumerated possible values . . .</xs:documentation>
+		</xs:annotation>
+	</xs:attribute>
+	<xs:attribute name="space" default="preserve">
+		<xs:simpleType>
+			<xs:restriction base="xs:NCName">
+				<xs:enumeration value="default"/>
+				<xs:enumeration value="preserve"/>
+			</xs:restriction>
+		</xs:simpleType>
+	</xs:attribute>
+	<xs:attribute name="base" type="xs:anyURI">
+		<xs:annotation>
+			<xs:documentation>See http://www.w3.org/TR/xmlbase/ for
+                     information about this attribute.</xs:documentation>
+		</xs:annotation>
+	</xs:attribute>
+	<xs:attributeGroup name="specialAttrs">
+		<xs:attribute ref="xml:base"/>
+		<xs:attribute ref="xml:lang"/>
+		<xs:attribute ref="xml:space"/>
+	</xs:attributeGroup>
+</xs:schema>

+ 24 - 0
schema/oadr_xmldsig-properties-schema.xsd

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:dsp="http://openadr.org/oadr-2.0b/2012/07/xmldsig-properties"
+        targetNamespace="http://openadr.org/oadr-2.0b/2012/07/xmldsig-properties"
+        version="0.1" elementFormDefault="qualified">
+
+  <element name="ReplayProtect" type="dsp:ReplayProtectType"/>
+  <complexType name="ReplayProtectType" >
+    <sequence>
+      <element name="timestamp" type="dateTime"/>
+      <element name="nonce" type="dsp:NonceValueType"/>
+    </sequence>
+  </complexType>
+
+  <complexType name="NonceValueType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="EncodingType" type="anyURI"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+</schema>

+ 239 - 0
schema/oadr_xmldsig.xsd

@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="utf-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" version="0.1">
+	<!-- Basic Types Defined for Signatures -->
+	<simpleType name="CryptoBinary">
+		<restriction base="base64Binary"/>
+	</simpleType>
+	<!-- Start Signature -->
+	<element name="Signature" type="ds:SignatureType"/>
+	<complexType name="SignatureType">
+		<sequence>
+			<element ref="ds:SignedInfo"/>
+			<element ref="ds:SignatureValue"/>
+			<element ref="ds:KeyInfo" minOccurs="0"/>
+			<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<element name="SignatureValue" type="ds:SignatureValueType"/>
+	<complexType name="SignatureValueType">
+		<simpleContent>
+			<extension base="base64Binary">
+				<attribute name="Id" type="ID" use="optional"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<!-- Start SignedInfo -->
+	<element name="SignedInfo" type="ds:SignedInfoType"/>
+	<complexType name="SignedInfoType">
+		<sequence>
+			<element ref="ds:CanonicalizationMethod"/>
+			<element ref="ds:SignatureMethod"/>
+			<element ref="ds:Reference" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+	<complexType name="CanonicalizationMethodType" mixed="true">
+		<sequence>
+			<any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+			<!-- (0,unbounded) elements from (1,1) namespace -->
+		</sequence>
+		<attribute name="Algorithm" type="anyURI" use="required"/>
+	</complexType>
+	<element name="SignatureMethod" type="ds:SignatureMethodType"/>
+	<complexType name="SignatureMethodType" mixed="true">
+		<sequence>
+			<element name="HMACOutputLength" type="ds:HMACOutputLengthType" minOccurs="0"/>
+			<any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+			<!-- (0,unbounded) elements from (1,1) external namespace -->
+		</sequence>
+		<attribute name="Algorithm" type="anyURI" use="required"/>
+	</complexType>
+	<!-- Start Reference -->
+	<element name="Reference" type="ds:ReferenceType"/>
+	<complexType name="ReferenceType">
+		<sequence>
+			<element ref="ds:Transforms" minOccurs="0"/>
+			<element ref="ds:DigestMethod"/>
+			<element ref="ds:DigestValue"/>
+		</sequence>
+		<attribute name="Id" type="ID" use="optional"/>
+		<attribute name="URI" type="anyURI" use="optional"/>
+		<attribute name="Type" type="anyURI" use="optional"/>
+	</complexType>
+	<element name="Transforms" type="ds:TransformsType"/>
+	<complexType name="TransformsType">
+		<sequence>
+			<element ref="ds:Transform" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<element name="Transform" type="ds:TransformType"/>
+	<complexType name="TransformType" mixed="true">
+		<choice minOccurs="0" maxOccurs="unbounded">
+			<any namespace="##other" processContents="lax"/>
+			<!-- (1,1) elements from (0,unbounded) namespaces -->
+			<element name="XPath" type="string"/>
+		</choice>
+		<attribute name="Algorithm" type="anyURI" use="required"/>
+	</complexType>
+	<!-- End Reference -->
+	<element name="DigestMethod" type="ds:DigestMethodType"/>
+	<complexType name="DigestMethodType" mixed="true">
+		<sequence>
+			<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="Algorithm" type="anyURI" use="required"/>
+	</complexType>
+	<element name="DigestValue" type="ds:DigestValueType"/>
+	<simpleType name="DigestValueType">
+		<restriction base="base64Binary"/>
+	</simpleType>
+	<!-- End SignedInfo -->
+	<!-- Start KeyInfo -->
+	<element name="KeyInfo" type="ds:KeyInfoType"/>
+	<complexType name="KeyInfoType" mixed="true">
+		<choice maxOccurs="unbounded">
+			<element ref="ds:KeyName"/>
+			<element ref="ds:KeyValue"/>
+			<element ref="ds:RetrievalMethod"/>
+			<element ref="ds:X509Data"/>
+			<element ref="ds:PGPData"/>
+			<element ref="ds:SPKIData"/>
+			<element ref="ds:MgmtData"/>
+			<any namespace="##other" processContents="lax"/>
+			<!-- (1,1) elements from (0,unbounded) namespaces -->
+		</choice>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<element name="KeyName" type="string"/>
+	<element name="MgmtData" type="string"/>
+	<element name="KeyValue" type="ds:KeyValueType"/>
+	<complexType name="KeyValueType" mixed="true">
+		<choice>
+			<element ref="ds:DSAKeyValue"/>
+			<element ref="ds:RSAKeyValue"/>
+			<any namespace="##other" processContents="lax"/>
+		</choice>
+	</complexType>
+	<element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+	<complexType name="RetrievalMethodType">
+		<sequence>
+			<element ref="ds:Transforms" minOccurs="0"/>
+		</sequence>
+		<attribute name="URI" type="anyURI"/>
+		<attribute name="Type" type="anyURI" use="optional"/>
+	</complexType>
+	<!-- Start X509Data -->
+	<element name="X509Data" type="ds:X509DataType"/>
+	<complexType name="X509DataType">
+		<sequence maxOccurs="unbounded">
+			<choice>
+				<element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+				<element name="X509SKI" type="base64Binary"/>
+				<element name="X509SubjectName" type="string"/>
+				<element name="X509Certificate" type="base64Binary"/>
+				<element name="X509CRL" type="base64Binary"/>
+				<any namespace="##other" processContents="lax"/>
+			</choice>
+		</sequence>
+	</complexType>
+	<complexType name="X509IssuerSerialType">
+		<sequence>
+			<element name="X509IssuerName" type="string"/>
+			<element name="X509SerialNumber" type="integer"/>
+		</sequence>
+	</complexType>
+	<!-- End X509Data -->
+	<!-- Begin PGPData -->
+	<element name="PGPData" type="ds:PGPDataType"/>
+	<complexType name="PGPDataType">
+		<choice>
+			<sequence>
+				<element name="PGPKeyID" type="base64Binary"/>
+				<element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+				<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+			</sequence>
+			<sequence>
+				<element name="PGPKeyPacket" type="base64Binary"/>
+				<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+			</sequence>
+		</choice>
+	</complexType>
+	<!-- End PGPData -->
+	<!-- Begin SPKIData -->
+	<element name="SPKIData" type="ds:SPKIDataType"/>
+	<complexType name="SPKIDataType">
+		<sequence maxOccurs="unbounded">
+			<element name="SPKISexp" type="base64Binary"/>
+			<any namespace="##other" processContents="lax" minOccurs="0"/>
+		</sequence>
+	</complexType>
+	<!-- End SPKIData -->
+	<!-- End KeyInfo -->
+	<!-- Start Object (Manifest, SignatureProperty) -->
+	<element name="Object" type="ds:ObjectType"/>
+	<complexType name="ObjectType" mixed="true">
+		<sequence minOccurs="0" maxOccurs="unbounded">
+			<any namespace="##any" processContents="lax"/>
+		</sequence>
+		<attribute name="Id" type="ID" use="optional"/>
+		<attribute name="MimeType" type="string" use="optional"/>
+		<attribute name="Encoding" type="anyURI" use="optional"/>
+		<!-- add a grep facet -->
+	</complexType>
+	<element name="Manifest" type="ds:ManifestType"/>
+	<complexType name="ManifestType">
+		<sequence>
+			<element ref="ds:Reference" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+	<complexType name="SignaturePropertiesType">
+		<sequence>
+			<element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+	<complexType name="SignaturePropertyType" mixed="true">
+		<choice maxOccurs="unbounded">
+			<any namespace="##other" processContents="lax"/>
+			<!-- (1,1) elements from (1,unbounded) namespaces -->
+		</choice>
+		<attribute name="Target" type="anyURI" use="required"/>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<!-- End Object (Manifest, SignatureProperty) -->
+	<!-- Start Algorithm Parameters -->
+	<simpleType name="HMACOutputLengthType">
+		<restriction base="integer"/>
+	</simpleType>
+	<!-- Start KeyValue Element-types -->
+	<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+	<complexType name="DSAKeyValueType">
+		<sequence>
+			<sequence minOccurs="0">
+				<element name="P" type="ds:CryptoBinary"/>
+				<element name="Q" type="ds:CryptoBinary"/>
+			</sequence>
+			<element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+			<element name="Y" type="ds:CryptoBinary"/>
+			<element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+			<sequence minOccurs="0">
+				<element name="Seed" type="ds:CryptoBinary"/>
+				<element name="PgenCounter" type="ds:CryptoBinary"/>
+			</sequence>
+		</sequence>
+	</complexType>
+	<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+	<complexType name="RSAKeyValueType">
+		<sequence>
+			<element name="Modulus" type="ds:CryptoBinary"/>
+			<element name="Exponent" type="ds:CryptoBinary"/>
+		</sequence>
+	</complexType>
+	<!-- End KeyValue Element-types -->
+	<!-- End Signature -->
+</schema>

+ 120 - 0
schema/oadr_xmldsig11.xsd

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+#
+# Copyright ©[2011] World Wide Web Consortium 
+# (Massachusetts Institute of Technology,  
+#  European Research Consortium for Informatics and Mathematics, 
+#  Keio University). All Rights Reserved.  
+# This work is distributed under the W3C® Software License [1] in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. 
+# [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+#
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsig11="http://www.w3.org/2009/xmldsig11#" targetNamespace="http://www.w3.org/2009/xmldsig11#" elementFormDefault="qualified" version="0.1">
+	<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="oadr_xmldsig.xsd"/>
+	<element name="ECKeyValue" type="dsig11:ECKeyValueType"/>
+	<complexType name="ECKeyValueType">
+		<sequence>
+			<choice>
+				<element name="ECParameters" type="dsig11:ECParametersType"/>
+				<element name="NamedCurve" type="dsig11:NamedCurveType"/>
+			</choice>
+			<element name="PublicKey" type="dsig11:ECPointType"/>
+		</sequence>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<complexType name="NamedCurveType">
+		<attribute name="URI" type="anyURI" use="required"/>
+	</complexType>
+	<simpleType name="ECPointType">
+		<restriction base="ds:CryptoBinary"/>
+	</simpleType>
+	<complexType name="ECParametersType">
+		<sequence>
+			<element name="FieldID" type="dsig11:FieldIDType"/>
+			<element name="Curve" type="dsig11:CurveType"/>
+			<element name="Base" type="dsig11:ECPointType"/>
+			<element name="Order" type="ds:CryptoBinary"/>
+			<element name="CoFactor" type="integer" minOccurs="0"/>
+			<element name="ValidationData" type="dsig11:ECValidationDataType" minOccurs="0"/>
+		</sequence>
+	</complexType>
+	<complexType name="FieldIDType">
+		<choice>
+			<element ref="dsig11:Prime"/>
+			<element ref="dsig11:TnB"/>
+			<element ref="dsig11:PnB"/>
+			<element ref="dsig11:GnB"/>
+			<any namespace="##other" processContents="lax"/>
+		</choice>
+	</complexType>
+	<complexType name="CurveType">
+		<sequence>
+			<element name="A" type="ds:CryptoBinary"/>
+			<element name="B" type="ds:CryptoBinary"/>
+		</sequence>
+	</complexType>
+	<complexType name="ECValidationDataType">
+		<sequence>
+			<element name="seed" type="ds:CryptoBinary"/>
+		</sequence>
+		<attribute name="hashAlgorithm" type="anyURI" use="required"/>
+	</complexType>
+	<element name="Prime" type="dsig11:PrimeFieldParamsType"/>
+	<complexType name="PrimeFieldParamsType">
+		<sequence>
+			<element name="P" type="ds:CryptoBinary"/>
+		</sequence>
+	</complexType>
+	<element name="GnB" type="dsig11:CharTwoFieldParamsType"/>
+	<complexType name="CharTwoFieldParamsType">
+		<sequence>
+			<element name="M" type="positiveInteger"/>
+		</sequence>
+	</complexType>
+	<element name="TnB" type="dsig11:TnBFieldParamsType"/>
+	<complexType name="TnBFieldParamsType">
+		<complexContent>
+			<extension base="dsig11:CharTwoFieldParamsType">
+				<sequence>
+					<element name="K" type="positiveInteger"/>
+				</sequence>
+			</extension>
+		</complexContent>
+	</complexType>
+	<element name="PnB" type="dsig11:PnBFieldParamsType"/>
+	<complexType name="PnBFieldParamsType">
+		<complexContent>
+			<extension base="dsig11:CharTwoFieldParamsType">
+				<sequence>
+					<element name="K1" type="positiveInteger"/>
+					<element name="K2" type="positiveInteger"/>
+					<element name="K3" type="positiveInteger"/>
+				</sequence>
+			</extension>
+		</complexContent>
+	</complexType>
+	<element name="DEREncodedKeyValue" type="dsig11:DEREncodedKeyValueType"/>
+	<complexType name="DEREncodedKeyValueType">
+		<simpleContent>
+			<extension base="base64Binary">
+				<attribute name="Id" type="ID" use="optional"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<element name="KeyInfoReference" type="dsig11:KeyInfoReferenceType"/>
+	<complexType name="KeyInfoReferenceType">
+		<attribute name="URI" type="anyURI" use="required"/>
+		<attribute name="Id" type="ID" use="optional"/>
+	</complexType>
+	<element name="X509Digest" type="dsig11:X509DigestType"/>
+	<complexType name="X509DigestType">
+		<simpleContent>
+			<extension base="base64Binary">
+				<attribute name="Algorithm" type="anyURI" use="required"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+</schema>

+ 2 - 2
setup.py

@@ -4,11 +4,11 @@ with open("README.md", "r") as fh:
     long_description = fh.read()
 
 setup(name="pyopenadr",
-      version="0.1.4",
+      version="0.2.0",
       description="Python library for dealing with OpenADR",
       long_description=long_description,
       long_description_content_type="text/markdown",
       url="https://git.finetuned.nl/stan/pyopenadr",
       packages=['pyopenadr', 'pyopenadr.service'],
       include_package_data=True,
-      install_requires=['xmltodict', 'responder', 'apscheduler'])
+      install_requires=['xmltodict', 'responder', 'apscheduler', 'uvloop==0.12'])

+ 161 - 0
test/test_message_conversion.py

@@ -0,0 +1,161 @@
+from pyopenadr.utils import create_message, parse_message, generate_id
+from pprint import pprint
+from termcolor import colored
+from datetime import datetime, timezone, timedelta
+
+DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
+
+def create_dummy_event(ven_id):
+    """
+    Creates a dummy event
+    """
+    now = datetime.now(timezone.utc)
+    event_id = generate_id()
+    active_period = {"dtstart": (now + timedelta(minutes=1)),
+                     "duration": timedelta(minutes=10)}
+    event_descriptor = {"event_id": event_id,
+                        "modification_number": 1,
+                        "modification_date_time": now,
+                        "priority": 1,
+                        "market_context": "http://MarketContext1",
+                        "created_date_time": now,
+                        "event_status": "near",
+                        "test_event": False,
+                        "vtn_comment": "This is an event"}
+    event_signals = [{"intervals": [{"duration": timedelta(minutes=1), "uid": 1, "signal_payload": 8},
+                                    {"duration": timedelta(minutes=1), "uid": 2, "signal_payload": 10},
+                                    {"duration": timedelta(minutes=1), "uid": 3, "signal_payload": 12},
+                                    {"duration": timedelta(minutes=1), "uid": 4, "signal_payload": 14},
+                                    {"duration": timedelta(minutes=1), "uid": 5, "signal_payload": 16},
+                                    {"duration": timedelta(minutes=1), "uid": 6, "signal_payload": 18},
+                                    {"duration": timedelta(minutes=1), "uid": 7, "signal_payload": 20},
+                                    {"duration": timedelta(minutes=1), "uid": 8, "signal_payload": 10},
+                                    {"duration": timedelta(minutes=1), "uid": 9, "signal_payload": 20}],
+                    "signal_name": "LOAD_CONTROL",
+                    #"signal_name": "simple",
+                    #"signal_type": "level",
+                    "signal_type": "x-loadControlCapacity",
+                    "signal_id": generate_id(),
+                    "current_value": 12.34}]
+    event_targets = [{"ven_id": 'VEN001'}, {"ven_id": 'VEN002'}]
+    event = {'active_period': active_period,
+             'event_descriptor': event_descriptor,
+             'event_signals': event_signals,
+             'targets': event_targets,
+             'response_required': 'always'}
+    return event
+
+def test_message(message_type, **data):
+    message = create_message(message_type, **data)
+    #print(message)
+    parsed = parse_message(message)[1]
+
+    if parsed == data:
+        print(colored(f"pass {message_type}", "green"))
+    else:
+        pprint(data)
+        print(message)
+        pprint(parsed)
+        print(colored(f"fail {message_type}", "red"))
+
+test_message('oadrCanceledOpt', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, opt_id=generate_id())
+test_message('oadrCanceledPartyRegistration', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, registration_id=generate_id(), ven_id='123ABC')
+test_message('oadrCanceledReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}])
+test_message('oadrCanceledReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}], ven_id='123ABC')
+test_message('oadrCancelOpt', request_id=generate_id(), ven_id='123ABC', opt_id=generate_id())
+test_message('oadrCancelPartyRegistration', request_id=generate_id(), ven_id='123ABC', registration_id=generate_id())
+test_message('oadrCancelReport', request_id=generate_id(), ven_id='123ABC', report_request_id=generate_id(), report_to_follow=True)
+test_message('oadrCreatedEvent', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                 event_responses=[{'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(), 'event_id': generate_id(), 'modification_number': 1, 'opt_type': 'optIn'},
+                                                  {'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(), 'event_id': generate_id(), 'modification_number': 1, 'opt_type': 'optIn'},
+                                                  {'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(), 'event_id': generate_id(), 'modification_number': 1, 'opt_type': 'optIn'}],
+                                 ven_id='123ABC')
+test_message('oadrCreatedReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}], ven_id='123ABC')
+test_message('oadrCreatedEvent', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                 event_responses=[{'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(),
+                                                    'event_id': generate_id(),
+                                                    'modification_number': 1,
+                                                    'opt_type': 'optIn'},
+                                                    {'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(),
+                                                    'event_id': generate_id(),
+                                                    'modification_number': 1,
+                                                    'opt_type': 'optOut'}],
+                                 ven_id='123ABC')
+test_message('oadrCreatedPartyRegistration', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                             registration_id=generate_id(),
+                                             ven_id='123ABC',
+                                             profiles=[{'profile_name': '2.0b',
+                                                        'transports': [{'transport_name': 'simpleHttp'}]}],
+                                             vtn_id='VTN123')
+test_message('oadrCreatedReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}])
+test_message('oadrCreateOpt', opt_id=generate_id(),
+                              opt_type='optIn',
+                              opt_reason='participating',
+                              created_date_time=datetime.now(timezone.utc),
+                              request_id=generate_id(),
+                              event_id=generate_id(),
+                              modification_number=1,
+                              targets=[{'ven_id': '123ABC'}],
+                              ven_id='VEN123')
+test_message('oadrCreatePartyRegistration', request_id=generate_id(), ven_id='123ABC', profile_name='2.0b', transport_name='simpleHttp', transport_address='http://localhost', report_only=False, xml_signature=False, ven_name='test', http_pull_model=True)
+test_message('oadrCreateReport', request_id=generate_id(),
+                                 ven_id='123ABC',
+                                 report_requests=[{'report_request_id': 'd2b7bade5f',
+                                                  'report_specifier': {'granularity': timedelta(seconds=900),
+                                                                       'report_back_duration': timedelta(seconds=900),
+                                                                       'report_interval': {'dtstart': datetime(2019, 11, 19, 11, 0, 18, 672768, tzinfo=timezone.utc),
+                                                                                           'duration': timedelta(seconds=7200),
+                                                                                           'tolerance': {'tolerate': {'startafter': timedelta(seconds=300)}}},
+                                                                       'report_specifier_id': '9c8bdc00e7',
+                                                                       'specifier_payload': {'r_id': 'd6e2e07485',
+                                                                                             'reading_type': 'Direct Read'}}}])
+test_message('oadrDistributeEvent', request_id=generate_id(), response={'request_id': 123, 'response_code': 200, 'response_description': 'OK'}, events=[create_dummy_event(ven_id='123ABC')], vtn_id='VTN123')
+test_message('oadrPoll', ven_id='123ABC')
+test_message('oadrQueryRegistration', request_id=generate_id())
+test_message('oadrRegisteredReport', ven_id='VEN123', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                     report_requests=[{'report_request_id': generate_id(),
+                                                       'report_specifier': {'report_specifier_id': generate_id(),
+                                                                            'granularity': timedelta(minutes=15),
+                                                                            'report_back_duration': timedelta(minutes=15),
+                                                                            'report_interval': {'dtstart': datetime.now(timezone.utc),
+                                                                                                'duration': timedelta(hours=2),
+                                                                                                'tolerance': {'tolerate': {'startafter': timedelta(minutes=5)}},
+                                                                                                'notification': timedelta(minutes=30),
+                                                                                                'ramp_up': timedelta(minutes=15),
+                                                                                                'recovery': timedelta(minutes=5)},
+                                                                            'specifier_payload': {'r_id': generate_id(),
+                                                                                                  'reading_type': 'Direct Read'}}},
+                                                      {'report_request_id': generate_id(),
+                                                       'report_specifier': {'report_specifier_id': generate_id(),
+                                                                            'granularity': timedelta(minutes=15),
+                                                                            'report_back_duration': timedelta(minutes=15),
+                                                                            'report_interval': {'dtstart': datetime.now(timezone.utc),
+                                                                                                'duration': timedelta(hours=2),
+                                                                                                'tolerance': {'tolerate': {'startafter': timedelta(minutes=5)}},
+                                                                                                'notification': timedelta(minutes=30),
+                                                                                                'ramp_up': timedelta(minutes=15),
+                                                                                                'recovery': timedelta(minutes=5)},
+                                                                            'specifier_payload': {'r_id': generate_id(),
+                                                                                                  'reading_type': 'Direct Read'}}}])
+test_message('oadrRequestEvent', request_id=generate_id(), ven_id='123ABC')
+test_message('oadrRequestReregistration', ven_id='123ABC')
+test_message('oadrRegisterReport', request_id=generate_id(), reports=[{'report_id': generate_id(),
+                                                                       'report_descriptions': [{
+                                                                            'r_id': generate_id(),
+                                                                            'report_subject': {'ven_id': '123ABC'},
+                                                                            'report_data_source': {'ven_id': '123ABC'},
+                                                                            'report_type': 'reading',
+                                                                            'reading_type': 'Direct Read',
+                                                                            'market_context': 'http://localhost',
+                                                                            'sampling_rate': {'min_period': timedelta(minutes=1), 'max_period': timedelta(minutes=1), 'on_change': True}}],
+                                                                       'report_request_id': generate_id(),
+                                                                       'report_specifier_id': generate_id(),
+                                                                       'report_name': 'HISTORY_USAGE',
+                                                                       'created_date_time': datetime.now(timezone.utc)}],
+                                                        ven_id='123ABC',
+                                                        report_request_id=generate_id())
+test_message('oadrResponse', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, ven_id='123ABC')
+test_message('oadrResponse', response={'response_code': 200, 'response_description': 'OK', 'request_id': None}, ven_id='123ABC')
+#test_message('oadrUpdatedReport')
+#test_message('oadrUpdateReport')
+

+ 171 - 0
test/test_schema.py

@@ -0,0 +1,171 @@
+from pyopenadr.utils import create_message, generate_id
+from lxml import etree
+import os
+from datetime import datetime, timedelta, timezone
+from termcolor import colored
+import jinja2
+
+DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
+SCHEMA_LOCATION = os.path.join('schema', 'oadr_20b.xsd')
+
+schema_root = etree.parse(SCHEMA_LOCATION)
+schema = etree.XMLSchema(schema_root)
+parser = etree.XMLParser(schema=schema)
+
+def create_dummy_event(ven_id):
+    """
+    Creates a dummy event
+    """
+    now = datetime.now(timezone.utc)
+    event_id = generate_id()
+    active_period = {"dtstart": now + timedelta(minutes=1),
+                     "duration": timedelta(minutes=10)}
+
+    event_descriptor = {"event_id": event_id,
+                        "modification_number": 1,
+                        "modification_date_time": now,
+                        "priority": 1,
+                        "market_context": "http://MarketContext1",
+                        "created_date_time": now,
+                        "event_status": "near",
+                        "test_event": "false",
+                        "vtn_comment": "This is an event"}
+
+    event_signals = [{"intervals": [{"duration": "PT1M", "uid": 1, "signal_payload": 8},
+                                    {"duration": "PT1M", "uid": 2, "signal_payload": 10},
+                                    {"duration": "PT1M", "uid": 3, "signal_payload": 12},
+                                    {"duration": "PT1M", "uid": 4, "signal_payload": 14},
+                                    {"duration": "PT1M", "uid": 5, "signal_payload": 16},
+                                    {"duration": "PT1M", "uid": 6, "signal_payload": 18},
+                                    {"duration": "PT1M", "uid": 7, "signal_payload": 20},
+                                    {"duration": "PT1M", "uid": 8, "signal_payload": 10},
+                                    {"duration": "PT1M", "uid": 9, "signal_payload": 20}],
+                    "signal_name": "LOAD_CONTROL",
+                    #"signal_name": "simple",
+                    #"signal_type": "level",
+                    "signal_type": "x-loadControlCapacity",
+                    "signal_id": generate_id(),
+                    "current_value": 0.0}]
+
+    event_targets = [{"ven_id": 'VEN001'}, {"ven_id": 'VEN002'}]
+    event = {'active_period': active_period,
+             'event_descriptor': event_descriptor,
+             'event_signals': event_signals,
+             'targets': event_targets,
+             'response_required': 'always'}
+    return event
+
+# Test oadrPoll
+def test_message(type, **payload):
+    try:
+        message = create_message(type, **payload)
+        etree.fromstring(message.encode('utf-8'), parser)
+        print(colored(f"pass: {type} OK", "green"))
+    except etree.XMLSyntaxError as err:
+        print(colored(f"fail: {type} failed validation: {err}", "red"))
+        print(message)
+    except jinja2.exceptions.UndefinedError as err:
+        print(colored(f"fail: {type} failed message construction: {err}", "yellow"))
+
+
+test_message('oadrCanceledOpt', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, opt_id=generate_id())
+test_message('oadrCanceledPartyRegistration', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, registration_id=generate_id(), ven_id='123ABC')
+test_message('oadrCanceledReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}])
+test_message('oadrCanceledReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}], ven_id='123ABC')
+test_message('oadrCancelOpt', request_id=generate_id(), ven_id='123ABC', opt_id=generate_id())
+test_message('oadrCancelPartyRegistration', request_id=generate_id(), ven_id='123ABC', registration_id=generate_id())
+test_message('oadrCancelReport', request_id=generate_id(), ven_id='123ABC', report_request_id=generate_id(), report_to_follow=True)
+test_message('oadrCreatedEvent', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                 event_responses=[{'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(), 'event_id': generate_id(), 'modification_number': 1, 'opt_type': 'optIn'},
+                                                  {'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(), 'event_id': generate_id(), 'modification_number': 1, 'opt_type': 'optIn'},
+                                                  {'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(), 'event_id': generate_id(), 'modification_number': 1, 'opt_type': 'optIn'}],
+                                 ven_id='123ABC')
+test_message('oadrCreatedReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}], ven_id='123ABC')
+test_message('oadrCreatedEvent', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                 event_responses=[{'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(),
+                                                    'event_id': generate_id(),
+                                                    'modification_number': 1,
+                                                    'opt_type': 'optIn'},
+                                                    {'response_code': 200, 'response_description': 'OK', 'request_id': generate_id(),
+                                                    'event_id': generate_id(),
+                                                    'modification_number': 1,
+                                                    'opt_type': 'optOut'}],
+                                 ven_id='123ABC')
+test_message('oadrCreatedPartyRegistration', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                             registration_id=generate_id(),
+                                             ven_id='123ABC',
+                                             profiles=[{'profile_name': '2.0b',
+                                                        'transports': [{'transport_name': 'simpleHttp'}]}],
+                                             vtn_id='VTN123')
+test_message('oadrCreatedReport', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, pending_reports=[{'request_id': generate_id()}, {'request_id': generate_id()}])
+test_message('oadrCreateOpt', opt_id=generate_id(),
+                              opt_type='optIn',
+                              opt_reason='participating',
+                              created_date_time=datetime.now(timezone.utc),
+                              request_id=generate_id(),
+                              event_id=generate_id(),
+                              modification_number=1,
+                              targets=[{'ven_id': '123ABC'}],
+                              ven_id='VEN123')
+test_message('oadrCreatePartyRegistration', request_id=generate_id(), ven_id='123ABC', profile_name='2.0b', transport_name='simpleHttp', transport_address='http://localhost', report_only=False, xml_signature=False, ven_name='test', http_pull_model=True)
+test_message('oadrCreateReport', request_id=generate_id(),
+                                 ven_id='123ABC',
+                                 report_requests=[{'report_request_id': 'd2b7bade5f',
+                                                  'report_specifier': {'granularity': timedelta(seconds=900),
+                                                                       'report_back_duration': timedelta(seconds=900),
+                                                                       'report_interval': {'dtstart': datetime(2019, 11, 19, 11, 0, 18, 672768, tzinfo=timezone.utc),
+                                                                                           'duration': timedelta(seconds=7200),
+                                                                                           'tolerance': {'tolerate': {'startafter': timedelta(seconds=300)}}},
+                                                                       'report_specifier_id': '9c8bdc00e7',
+                                                                       'specifier_payload': {'r_id': 'd6e2e07485',
+                                                                                             'reading_type': 'Direct Read'}}}])
+test_message('oadrDistributeEvent', request_id=generate_id(), response={'request_id': 123, 'response_code': 200, 'response_description': 'OK'}, events=[create_dummy_event(ven_id='123ABC')], vtn_id='VTN123')
+test_message('oadrPoll', ven_id='123ABC')
+test_message('oadrQueryRegistration', request_id=generate_id())
+test_message('oadrRegisteredReport', ven_id='VEN123', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()},
+                                     report_requests=[{'report_request_id': generate_id(),
+                                                       'report_specifier': {'report_specifier_id': generate_id(),
+                                                                            'granularity': timedelta(minutes=15),
+                                                                            'report_back_duration': timedelta(minutes=15),
+                                                                            'report_interval': {'dtstart': datetime.now(timezone.utc),
+                                                                                                'duration': timedelta(hours=2),
+                                                                                                'tolerance': {'tolerate': {'startafter': timedelta(minutes=5)}},
+                                                                                                'notification': timedelta(minutes=30),
+                                                                                                'ramp_up': timedelta(minutes=15),
+                                                                                                'recovery': timedelta(minutes=5)},
+                                                                            'specifier_payload': {'r_id': generate_id(),
+                                                                                                  'reading_type': 'Direct Read'}}},
+                                                      {'report_request_id': generate_id(),
+                                                       'report_specifier': {'report_specifier_id': generate_id(),
+                                                                            'granularity': timedelta(minutes=15),
+                                                                            'report_back_duration': timedelta(minutes=15),
+                                                                            'report_interval': {'dtstart': datetime.now(timezone.utc),
+                                                                                                'duration': timedelta(hours=2),
+                                                                                                'tolerance': {'tolerate': {'startafter': timedelta(minutes=5)}},
+                                                                                                'notification': timedelta(minutes=30),
+                                                                                                'ramp_up': timedelta(minutes=15),
+                                                                                                'recovery': timedelta(minutes=5)},
+                                                                            'specifier_payload': {'r_id': generate_id(),
+                                                                                                  'reading_type': 'Direct Read'}}}])
+test_message('oadrRequestEvent', request_id=generate_id(), ven_id='123ABC')
+test_message('oadrRequestReregistration', ven_id='123ABC')
+test_message('oadrRegisterReport', request_id=generate_id(), reports=[{'report_id': generate_id(),
+                                                                       'report_descriptions': [{
+                                                                            'r_id': generate_id(),
+                                                                            'report_subject': {'ven_id': '123ABC'},
+                                                                            'report_data_source': {'ven_id': '123ABC'},
+                                                                            'report_type': 'reading',
+                                                                            'reading_type': 'Direct Read',
+                                                                            'market_context': 'http://localhost',
+                                                                            'sampling_rate': {'min_period': timedelta(minutes=1), 'max_period': timedelta(minutes=1), 'on_change': True}}],
+                                                                       'report_request_id': generate_id(),
+                                                                       'report_specifier_id': generate_id(),
+                                                                       'report_name': 'HISTORY_USAGE',
+                                                                       'created_date_time': datetime.now(timezone.utc)}],
+                                                        ven_id='123ABC',
+                                                        report_request_id=generate_id())
+test_message('oadrResponse', response={'response_code': 200, 'response_description': 'OK', 'request_id': generate_id()}, ven_id='123ABC')
+test_message('oadrResponse', response={'response_code': 200, 'response_description': 'OK', 'request_id': None}, ven_id='123ABC')
+# test_message('oadrUpdatedReport')
+# test_message('oadrUpdateReport')
+

+ 2 - 0
test_requirements.txt

@@ -0,0 +1,2 @@
+lxml
+termcolor