XML Schema - How to specify the country of the identifier's issuing authority

07/08/2012

We are providing identifiers for natural and legal persons, using ‚identifierType‘ to define type of identificator (note that ‚identifierType‘ is independent of the Country of origin):

  1. http://www.eu-spocs.eu/semantic/natural-person/national-id-no - national identity number for natural person
  2. http://www.eu-spocs.eu/semantic/legal-person/primary-id - primary legal entity identity number (which number is primary depends on the country)
  In xml this looks like:   <cva:Cvidentifier> <cvb:Identifier>31234567890</cvb:Identifier> <cvb:IdentifierType>http://www.eu-spocs.eu/semantic/natural-person/national-id-no</cvb:Iden…; <cvb:IssuingAuthority languageID="lt">Gyventojų registro tarnyba prie Lietuvos Respublikos vidaus reikalų ministerijos</cvb:IssuingAuthority> </cva:Cvidentifier>     Additionaly we need to know the country (country code) which issued identifier.   The question is, how to specify the country of the identifier‘s issuing authority?   Note that field ‚IssuingAuthority‘ can hold single string only (declared as ‚udt:TextType‘ in XML Schema)  

Component

Code

Category

support

Comments

Mon, 03/09/2012 - 05:34

 

Dear mr. Karalius,   The Core Vocabulary XML schema's reuse the UBL schema's and inherit UBL's extension mechanism. UBL Extensions make use of xsd:any and have a processValue attribute set to "skip", effectively allowing you to add any element you need to a Core Vocabulary implementation. For your particular case, you can define a UBLExtension for the Cvidentifier. A finer-grained extension mechanism, i.e. adding attributes to existing components, is not supported however.   An overview and samples of the UBL Extension mechanism are provided at http://www.schemacentral.com/sc/ubl20/e-ext_UBLExtension.html.   Thank you for choosing to implement the Core Business vocabulary. I hope the UBL extension mechanism will further help you.      

Fri, 14/09/2012 - 13:35

Dear Joinup SEMIC EDITOR,

thank you for the answer.

Could you clarify how can we define UBLExtension for Cvidentifier.

As far as I see, CvidentifierType has no UBLExtension element:

 <xsd:complexType name="CvidentifierType">
  <xsd:sequence>
   <xsd:element ref="cvb:Identifier"/>
   <xsd:element ref="cvb:IdentifierType" minOccurs="0"/>
   <xsd:element ref="cbc:IssueDate" minOccurs="0"/>
   <xsd:element ref="cvb:IssuingAuthority" minOccurs="0"/>
   <xsd:element ref="cvb:IssuingAuthorityID" minOccurs="0"/>
   <xsd:element ref="business:Cvbusiness" minOccurs="0" maxOccurs="unbounded"/>
   <xsd:element ref="person:Cvperson" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
 </xsd:complexType>

Fri, 21/09/2012 - 09:32

Dear mr Karalius

the UBL extension mechanism requires you to define the extensions as the first level element in the XML document. The sample below indicates the information you need to add to construct a valid document. Summarising, there are four steps to add your extension: 

1) Define the namespaces for your extensions in the document

2) Add a UBLExtensions element as the first element

3) Add the extension metadata (the exact elements are documented at http://www.schemacentral.com/sc/ubl20/e-ext_UBLExtension.html)

4) Create an extension, consisting of the original component (cva:Identifier in this case) and add any additional information.

 

<CoreBusiness      ...     xmlns:mycac="urn:x-mycompany:aggregates"     xmlns:mycbc="urn:x-mycompany:basics"     xmlns:myext="urn:x-mycompany:extension"     ...>   <ext:UBLExtensions>     <ext:UBLExtension>         ...         extension metadata         ...         <ext:ExtensionContent>             <myext:ExtendedCvIdentifier>                 <mycbc:IssuingAuthorityCountry>EN</mycbc:IssuingAuthorityCountry>                 <cva:Cvidentifier>                     <cvb:Identifier>31234567890</cvb:Identifier>                     <cvb:IdentifierType>http://www.eu-spocs.eu/semantic/natural-person/national-id-no</cvb:Iden…;                     <cvb:IssuingAuthority languageID="lt">...</cvb:IssuingAuthority>                 </cva:Cvidentifier>             </myext:ExtendedCvIdentifier>         <ext:ExtensionContent>     </ext:UBLExtension> </ext:UBLExtensions>   <cvb:LegalName> ... </cvb:LegalName>   More detailed information is available in the UBL customization guidelines, available at http://docs.oasis-open.org/ubl/guidelines/UBL-Customization1.0.html#_To…    

Fri, 21/09/2012 - 11:42

Dear Niels,

thank you for the explanation.

Actually we hoped for more elegant and straightforward solution.

We use multiple business and person elements inside our xml. Therefore, it would require to extract multiple elements of our xml into UBLExtensions section (furhtermore, we would need to relate somehow business and person elements from "main" xml section with identifiers in UBLExtensions). It is too complicated.

I think, we'll use CvidentifierType/IssuingAuthorityID element to hold Country codes as a workaround.

The content of this field is kept private and will not be shown publicly.