eForms-SDK icon indicating copy to clipboard operation
eForms-SDK copied to clipboard

Allow adding own UBL Extensions within eforms customized UBL-XSD to enable German tailoring required by German law

Open rkottmann opened this issue 4 months ago • 3 comments

Currently, we have a severe showstopper in order to implement German legal requirements in eForms-DE. For our national change requests we require some new BTs (BT-DEX-01, BT-DEX-02, BT-DEX-03). Here are the issues currently blocked:

  • https://projekte.kosit.org/eforms/eforms-de-specification/-/issues/78 BT-DEX-01 | New national BT: "Berichtseinheit-ID"
  • https://projekte.kosit.org/eforms/eforms-de-specification/-/issues/77 BT-DEX-02 | New national BT and Codelist: "Stellen der Nachhaltigkeitskriterien"
  • https://projekte.kosit.org/eforms/eforms-de-specification/-/issues/80 BT-DEX-03 | New national BT: "CVD - Ausnahmefall"

Because we need to work with your customized UBL-XSD, we need to be able to introduce our own UBL extension, so that we can define the syntax bindings for those German BTs.

However, the way you extended UBL stopps us from adding own national extensions.

Currently, the XML documents CN, PIN or CAN can be extended using the UBLExtensions element which consists of UBLExtension elements which can have ExtensionContent elements. The type of ExtensionContent element is defined in UBL-ExtensionContentDataType-2.3.xsd where the only allowed element is EformsExtension (which is then defined in EFORMS-ExtensionApex-2.3.xsd). This way you introduced strict definition for the ExtensionContent which then removes the possibility to introduce customized extensions for different purposes, depending on the needs of user.

Hence, we kindly ask you, if it would be possible to allow other extension already in upcoming 1.14 release (otherwise, we won't be able to fullfil German legal reqirements in time). Technically, the required change to your XSD as simple as follows:

Possible Extension outside eForms-Extension (mocked)

Change UBL-ExtensionContentDataType-2.3.xsd to

 <!-- ===== Type Declaration ===== -->
  <xsd:complexType name="ExtensionContentType">
     <!-- sequence as of original UBL -->
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <xsd:element ref="efext:EformsExtension" />
      <xsd:any namespace="##other" processContents="lax" minOccurs="0"
        maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>
Any element in any namespace other than the UBL extension namespace is allowed to be the apex element of an extension. Only those elements found in the UBL schemas and in the trees of schemas imported in this module are validated. Any element for which there is no schema declaration in any of the trees of schemas passes validation and is not treated as a schema constraint violation.
</xsd:documentation>
        </xsd:annotation>
      </xsd:any>

    </xsd:sequence>
  </xsd:complexType>

Result:

<ext:ExtensionContent>
   <efext:EformsExtension>
     <efac:AwardCriterionParameter>
       <efbc:ParameterCode listName="number-weight">per-exa</efbc:ParameterCode>
       <efbc:ParameterNumeric>40.00</efbc:ParameterNumeric>
     </efac:AwardCriterionParameter>
     
   </efext:EformsExtension>
   
   <!-- National extension outside  eForms extension -->
   <german:extended-element xmlns:german="german-extension-namespace" />

</ext:ExtensionContent>

Possible Extension inside eForms-Extension (mocked)

Change EFORMS-ExtensionApex-2.3.xsd:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://data.europa.eu/p27/eforms-ubl-extensions/1"
  xmlns:efext="http://data.europa.eu/p27/eforms-ubl-extensions/1"
  xmlns:efac="http://data.europa.eu/p27/eforms-ubl-extension-aggregate-components/1"
  xmlns:efbc="http://data.europa.eu/p27/eforms-ubl-extension-basic-components/1"
  xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
  xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
  targetNamespace="http://data.europa.eu/p27/eforms-ubl-extensions/1"
  elementFormDefault="qualified" attributeFormDefault="unqualified">
 <!-- left out for brevity -->
  <xsd:element name="EformsExtension">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="efbc:AccessToolName" minOccurs="0"
          maxOccurs="unbounded" />
<!-- left out for brevity -->

        <xsd:element ref="efac:TenderSubcontractingRequirements" minOccurs="0"
          maxOccurs="unbounded" />

  <xsd:element name="national-extensions" minOccurs="0" maxOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:any namespace="##other" processContents="skip" minOccurs="1"
                maxOccurs="unbounded">
                <xsd:annotation>
                  <xsd:documentation>
Any element in any namespace other than the UBL extension namespace is allowed to be the apex element of an extension. Only those elements found in the UBL schemas and in the trees of schemas imported in this module are validated. Any element for which there is no schema declaration in any of the trees of schemas passes validation and is not treated as a schema constraint violation.
</xsd:documentation>
                </xsd:annotation>
              </xsd:any>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Result:

<ext:UBLExtensions>
              <ext:UBLExtension>
                <ext:ExtensionContent>
                  <efext:EformsExtension>
                    <efac:AwardCriterionParameter>
                      <efbc:ParameterCode listName="number-weight"
                        >per-exa</efbc:ParameterCode>
                      <efbc:ParameterNumeric>40.00</efbc:ParameterNumeric>
                    </efac:AwardCriterionParameter>
                    <!-- National extension inside  eForms extension -->
                    <efext:national-extensions>

                      <german:extended-element
                        xmlns:german="german-extension-namespace" />

                    </efext:national-extensions>


                  </efext:EformsExtension>

                </ext:ExtensionContent>
              </ext:UBLExtension>
            </ext:UBLExtensions>

Any of those or even both would help us tremendously in implementing German requirements using eForms.

thx for your consideration

rkottmann avatar Aug 07 '25 11:08 rkottmann

As said this is very important requirement in Germany. Any feedback?

rkottmann avatar Aug 28 '25 08:08 rkottmann

Hi, In the submitted XML is only expected information structured a known way, therefore no other extensions than the defined ones are accepted. This does not prevent the local tailoring following local needs,

YvesJo avatar Sep 26 '25 07:09 YvesJo

It does prevent it, as explained above. Please explain, how to do local tailoring in your opinion to prove me wrong. Just stating the opposite is not constructive and does not help.

If you would allow the above solution, it would save a lot of effort, redundancies and hence inconsistencies.

Maybe, I should have mentioned that TED would not receive any XML with the local extension. It would be deleted before submitting to TED. So, you would not need to take care of anything else.

rkottmann avatar Oct 07 '25 12:10 rkottmann