UBL Naming and Design Rules SC

 View Only

[ubl-ndrsc] RE: [ubl-lcsc] Further namespace issues

  • 1.  [ubl-ndrsc] RE: [ubl-lcsc] Further namespace issues

    Posted 01-24-2003 22:12
    Here's the changes I made by hand: To the top-level element in UBL_Library_0p70_Reusable.xsd I added: targetNamespace="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" xmlns="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" To the top-level element in e.g. UBL_Library_0p70_Order.xsd I added: xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" Then I added a child: <xsd:import namespace="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" schemaLocation="UBL_Library_0p70_Reusable.xsd"/> When I went to validate that schema it became apparent that some of the qnames now needed qualification (since Aggregate types from the Reusable module were now explicitly in their own namespace). Element ref value "AllowanceCharge" became "cat:AllowanceCharge". "BuyerParty" -> "cat:BuyerParty" "Contract"-> "cat:Contract" "DeliveryTerms" -> "cat:DeliveryTerms" ...and many others -- you get the idea -- basically every ref to an element defined in cat:. Then I asked XML Spy to generate an Order. It qualified each element. I changed that doc so as to use "cat:" as the default namespace -- and removed the qualification so the instance looks nicer (see attachmenet). I had to doctor that doc a little, adding: /n:Order/OrderLine/DeliveryRequirement/DeliverySchedule/DeliveryRequirement (apparently, Spy doesn't handle the recursive definition DeliverySchedule->DeliveryRequirement->DeliverySchedule...) /n:Order/OrderLine/OrderedShipment/TransportEquipment/TransportEquipmentMeas urement/TransportEquipment (again, a recursive definition was involved TransportEquipment->TransportEquipmentMeasure->TransportEquipment...) The attached zip contains the generated Order instance (default namespace is "cat:" so only the Order elements are explicitly qualified) -- I think it's elegant enough (80/20 !!). Also included are the hand-doctored Order and Reusable schemas. I can doctor the other schemas if I must -- my preference would be to make one last (!) tweak to the Perl.