[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Correction Re: [ubl-dev] Customisation of specialised types
Fraser Correction: Please see note below > If you did want to replace the IdentifierType > with a 'specialized datatype' (alias 'qualified > datatype') you'd have to change/customize all > of the UBL 1.0 schemas to use them. > Then you would use a pattern facet, but > what xsd datatype > ( http://www.w3.org/TR/xmlschema-2/ > section 3), would your facet > pattern be derived from? It would probably > be string or normalized string and if so it could > be seen as a specialization of IdentifierType > since that would still give you the appropriate > 'supplementary component' metadata attributes > you want. (As with a telephone number, your > numeric part would likely have to preserve > leading zeros and so a pattern based on string > or normalized string might be best.) > > I think you then might have something like this: > > <?xml version="1.0" encoding="UTF-8"?> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns="My:SpecializedDatatypes-1.0" > xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParame > ters-1.0" > xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDatatyp > es-1.0" > xmlns:cur="urn:oasis:names:specification:ubl:schema:xsd:CurrencyCode-1.0" > targetNamespace="MySpecializedDatatypes-1.0" > elementFormDefault="qualified" > attributeFormDefault="unqualified" > version="1.0"> > <xsd:import > namespace="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParamet > ers-1.0" schemaLocation="UBL-CoreComponentParameters-1.0.xsd"/> > <xsd:import > namespace="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDatatyp > es-1.0" schemaLocation="UBL-UnspecializedDatatypes-1.0.xsd"/> > <xsd:import > namespace="urn:oasis:names:specification:ubl:schema:xsd:CurrencyCode-1.0" > schemaLocation="../codelist/UBL-CodeList-CurrencyCode-1.0.xsd"/> > <xsd:complexType name="MyIdentiferType"> > <xsd:simpleContent> > <xsd:restriction base="udt:IdentifierType"> > <xsd:pattern value='...[MyPattern]...'/> > <xsd:attribute name="identificationSchemeID" type="xsd:normalizedString" > use="optional"/> > <xsd:attribute name="identificationSchemeName" type="xsd:string" > use="optional"/> > <xsd:attribute name="identificationSchemeAgencyID" > type="xsd:normalizedString" use="optional"/> > <xsd:attribute name="identificationSchemeAgencyName" type="xsd:string" > use="optional"/> > <xsd:attribute name="identificationSchemeVersionID" > type="xsd:normalizedString" use="optional"/> > <xsd:attribute name="identificationSchemeURI" type="xsd:anyURI" > use="optional"/> > <xsd:attribute name="identificationSchemeDataURI" type="xsd:anyURI" > use="optional"/> > </xsd:restriction> > </xsd:simpleContent> > </xsd:complexType> > </xsd:schema> > This following bit is wrong, I think, since leaving out the attributes would of course restrict them out so the above is the more correct version. > Or, since this isn't restricting any of the attributes, I think you could > have: > > <?xml version="1.0" encoding="UTF-8"?> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns="My:SpecializedDatatypes-1.0" > xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParame > ters-1.0" > xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDatatyp > es-1.0" > xmlns:cur="urn:oasis:names:specification:ubl:schema:xsd:CurrencyCode-1.0" > targetNamespace="MySpecializedDatatypes-1.0" > elementFormDefault="qualified" > attributeFormDefault="unqualified" > version="1.0"> > <xsd:import > namespace="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParamet > ers-1.0" schemaLocation="UBL-CoreComponentParameters-1.0.xsd"/> > <xsd:import > namespace="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDatatyp > es-1.0" schemaLocation="UBL-UnspecializedDatatypes-1.0.xsd"/> > <xsd:import > namespace="urn:oasis:names:specification:ubl:schema:xsd:CurrencyCode-1.0" > schemaLocation="../codelist/UBL-CodeList-CurrencyCode-1.0.xsd"/> > <xsd:complexType name="MyIdentiferType"> > <xsd:simpleContent> > <xsd:restriction base="udt:IdentifierType"> > <xsd:pattern value='...[MyPattern]...'/> > </xsd:restriction> > </xsd:simpleContent> > </xsd:complexType> > </xsd:schema> > > > It is preferable to use the existing unspecialized datatype as > the base (xsd:base). > > Please note I haven't tested the above. If you do customize like > this (and can get something like the above to work), I'd personally keep > the existing UBL schemas as your main schemas and just use the above > to as a further step ('tight schemas') of secondary, internal validation, > unless you already have to customize all the other schemas for other > reasons. That's my opinion. > > All the best > > Stephen Green > > > > ----- Original Message ----- > From: "Fraser Crichton" <fraser.crichton@solnetsolutions.co.nz> > To: <ubl-dev@lists.oasis-open.org> > Sent: Monday, July 04, 2005 10:25 PM > Subject: [ubl-dev] Customisation of specialised types > > > > Hi, > > > > I have a dumb question. > > > > I'm interested in creating a customised Identifier type (a combination > > of a string and a number), the sector refers to this type as a number > > throughout all their business processes and systems and want to see it > > referred to as a Number in any XML messages. > > > > Would I create a new specialised datatype and extend from the > > udt:TextType? Would I create a completely new type based on xsd:string? > > How else could I achieve this ugliness and comply with the NDR? > > > > Cheers, > > > > Fraser > > > > -- > > Fraser Crichton > > XML Developer > > SolNet Solutions Limited > > L12, SolNet House, 70 The Terrace > > PO Box 397, Wellington, Aotearoa / New Zealand > > http://www.solnetsolutions.co.nz > > DDI: 04-462-5078 > > Mob: 027-278-3392 > > Fax: 04-462-5011 > > > > > > Attention: > > This email may contain information intended for the sole use of > > the original recipient. Please respect this when sharing or > > disclosing this email's contents with any third party. If you > > believe you have received this email in error, please delete it > > and notify the sender or postmaster@solnetsolutions.co.nz as > > soon as possible. The content of this email does not necessarily > > reflect the views of SolNet Solutions Ltd. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: ubl-dev-unsubscribe@lists.oasis-open.org > > For additional commands, e-mail: ubl-dev-help@lists.oasis-open.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ubl-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: ubl-dev-help@lists.oasis-open.org >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]