UBL Naming and Design Rules SC

[ubl-ndrsc] Tiny UBL Extension Example

  • 1.  [ubl-ndrsc] Tiny UBL Extension Example

    Posted 02-05-2003 20:55
    (cc-in LCSC since I know they're grappling with manual extension now too) Here's an example of a simple extension of the UBL 0p70 vocabulary. I've defined a schema module that defines the namespace "third-party". That schema imports the UBL Common Aggregate Types schema and defines an extension to AddressType. The new (sub)type defined in "third-party" is called MyAddressType. I've included two XML instances -- the first, order-ubl.xml is a valid UBL Order. The second, order-third-party.xml replaces one of the addresses in the order with an instance of MyAddressType. That instance is also a valid UBL Order -- but of course also includes the "third-party" schema. Here's the locality of change: ... <cat:Address xsi:type="p3:MyAddressType"> <cat:ID>token</cat:ID> ... The rest of the Address content (as defined by UBL) ... <cat:Country> <cat:Code>token</cat:Code> </cat:Country> <p3:MySpecialStuff>hello</p3:MySpecialStuff> </cat:Address> At the end of the content model you see the added element "MySpecialStuff". This all looks reasonable to me and addresses the concern I had earlier in the meeting (look ma -- a pun!). The extension schema is nice and short too -- only 13 lines! -Bill Attachment: extension-example.zip Description: Binary data