Skatteetaten / saf-t

Used for publishing of Norwegian SAF-T Schemas, codelists, testfiles etc. See also http://www.skatteetaten.no/saf-t for further documentation and information.
http://www.skatteetaten.no/saf-t
73 stars 111 forks source link

Using Namespace Extensions #19

Open kidahl opened 6 years ago

kidahl commented 6 years ago

It seems to me that the Norwegian version of the schema has removed the possibility of extending the schema using namespaces. For example, the OECD AuditFile headerstructure has

<xs:any namespace="##other" minOccurs="0">
   <xs:annotation>
      <xs:documentation>Represents space to allow individual Revenue Bodies to add further elements if required. See Annex A.</xs:documentation>
   </xs:annotation>
</xs:any>

This allows me to define my own schema with a custom namespace and insert my elements where the ANY declaration allows. All this without breaking the original schema compliance. In theory, much of the Norwegian adaptation probably could be implemented this way (I'm not saying that would be the correct approach for the Norwegian adaptation, but the namespace extension mechanism is pretty powerful.)

If I understand this correctly, further extensions with a custom namespace for a particular domain based on the unmodified Norwegian XSD will be impossible.

Would you reconsider removing the XS:ANY extensions from the Norwegian standard? Or do you recommend another approach to add custom information and still be compliant with the Norwegian spec?

nsali commented 6 years ago

In which cases is it necessary to add a custom namespace? Could you be a little more specific and describe the need for such an extension. Do I understand you correctly that you would rather insert custom elements to the same XML file and still be compliant with the Norwegian spec instead of creating a new XML file that uses another XSD?

kidahl commented 6 years ago

Yes, I would like to add additional optional information while being schema compliant. For example, I need a larger text field than what is allowed in the XSD.

  1. sep. 2018 kl. 09:48 skrev nsali notifications@github.com:

In which cases is it necessary to add a custom namespace? Could you be a little more specific and describe the need for such an extension. Do I understand you correctly that you would rather insert custom elements to the same XML file and still be compliant with the Norwegian spec insted of creating a new XML file that uses another XSD?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

nsali commented 6 years ago

Can you elaborate it a little more? What is the use cases?