[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: redefine extension samples
So now lets look at what changes with redefine. First I created drv_namespace.xsd that has the new GPScoordinates element that I want to add to the AddressType. I created drv_extensions-redefine.xsd. This imports the above schema to make the new element available. It then uses the <xsd:redefine> to include the UBL_Library_0p70_Reusable.xsd. This new schema has all the original definitions from that schema. Now look at what is inside the redefine. I am able to restrict and then extend the AddressType without introducing any new types. Now everywhere that referenced AddressType has this new definition. Because of the multiple files/namespaces that make up the UBL order, I actually had to edit the UBL Order schema to point at the same namespace that was used to reference UBL_Library_0p70_Reusable.xsd, but now the schemaLocation is set to point at my new redefining schema drv_extensions-redefine.xsd - the name of this new schema is ubl_library_0p70_Order-drv.xsd. I also change the original order sample to point to ubl_library_0p70_Order-drv.xsd as the source for the schema and it is named UN220OrderInstance1-drv.xml. This file no longer validates because it uses elements that are no longer part of Address. Note that both the BuyerParty and SellerParty are now wrong. The final file is the working sample with the Address element corrected and in one case it uses the GPScoordinates element. This file is Modified-UN220OrderInstance1-drv.xml. Notice that in the XML data streams I - had to have the new namespace for my extensions added (same as previous example), - I pointed to the updated UBL schema that was modified because of its inclusion of the one we actually did change to modify the AddressType. - The data stream no longer need the xsi:type - we don't have the side effect of having needed two new types to be created to support a restriction and extension - don't have the side effect of having multiple content models for Address. - I also lost a unique namespace for my extended schema - still end up with the same number of namespaces. ..dan
------------------------------------------------------- Danny Vint ACORD 1 Blue Hill Plaza PO Box 1529 dvint@acord.org Pearl River, NY 10965 http://www.acord.org Voice:510:522-4703 FAX: 801-749-3229
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]