OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Instance document & customized document type


Hi UBL Developers,

I would like to bother you again with a question related to customization. Maybe this is just a matter of subjective decision, but I would like to get your comments, anyway.

The question: How should one declare that a customized document type is used in an instance document:

Option 1) UBL document's namespace always used as a default namespace and xsi:type is being used to indicate that derived root type is being used. 
(Customization rule [3.2] ".The instance document should use the xsi:type attribute to indicate that a derived type is being used." Does this also apply to the document root or should it be handled otherwise?)

<Order
    ...
    xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-1.0"
    xmlns:po="mynamespace:Order-1.0"
    xsi:schemaLocation=
    "urn:oasis:names:specification:ubl:schema:xsd:Order-1.0 ../../xsd/maindoc/UBL-Order-1.0.xsd 
    mynamespace:Order-1.0 ../../xsd/maindoc/my-Order-1.0.xsd"
    xsi:type="po:MyOrderType">
  <BuyersID>123</BuyersID>
   ...
</Order>

Option 2) Customized document's namespace is always used as a default namespace. (Thus no need for xsi:type in the document root)

<Order
    ...
    xmlns:po="urn:oasis:names:specification:ubl:schema:xsd:Order-1.0"
    xmlns="mynamespace:Order-1.0"
    xsi:schemaLocation="mynamespace:Order-1.0 ../../xsd/maindoc/my-Order-1.0.xsd">
  <po:BuyersID>123</po:BuyersID>
    ...
</Order>

My validator says that both options work, but is one or another better or worse from some perspective?

With best regards,

Juha Ikävalko
TIEKE Tietoyhteiskunnan kehittämiskeskus ry 
TIEKE Finnish Information Society Development Centre 
Salomonkatu 17 A, 10th floor
FI-00100 Helsinki 
Tel +358 9 4763 0410, Fax +358 9 4763 0399
juha.ikavalko@tieke.fi
 




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]