[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [ubl-dev] Customisation of specialised types
Fraser, Hi, There's nothing particularly wrong with having the element name 'Number' with a datatype 'mysdt:NumberIdentifierType' based on 'udt:IdentifierType'. That is just a modeling decision rather than a CCTS rule as far as I know. If there was a rule then you could have the element name 'NumberID'. There is already a set of CEFACT ATG2 'qualified datatypes' (i.e. 'specialized datatypes' in UBL 1.0 terms) which include several different number-like datatypes so I'd advise staying clear of calling your datatype anything related to 'NumberType' since it would need to have Identifier-specific attributes which but I like 'mysdt:NumberIdentifierType' which is in line with Mark's suggestion and the element name could be something like 'myNumberID'. However, I thought your identifier was part alpha, part number, in which case you might want to have something like element 'myNumberID' (if that is a business requirement) with 'mysdt:CustomIdentifierType' as the datatype. All the best Steve ----- Original Message ----- From: "Fraser Crichton" <fraser.crichton@solnetsolutions.co.nz> To: "Stephen Green" <stephen_green@seventhproject.co.uk> Cc: <ubl-dev@lists.oasis-open.org> Sent: Thursday, July 07, 2005 12:15 AM Subject: Re: [ubl-dev] Customisation of specialised types > Hi, Stephen, > > Cheers for that I'd been thinking things would work that way. > > However it still leaves the ugly problem of business wanting to see > Number in place of ID or Identifier as the name of the type / element, > for example they want something like this - > > <myNumber>but I'm actually based on and use an Identifier type<myNumber> > > Which if I follow the UBL NDR should really be - > > <myID>I'm based on and used as an identifier type<myID> > > I that makes sense? Ugly, hah? > > Cheers, > > Fraser > > > > > Stephen Green wrote: > > >Fraser > > > >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:CoreComponentParam e > >ters-1.0" > >xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDataty p > >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:CoreComponentParame t > >ers-1.0" schemaLocation="UBL-CoreComponentParameters-1.0.xsd"/> > ><xsd:import > >namespace="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDataty p > >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> > > > >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:CoreComponentParam e > >ters-1.0" > >xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDataty p > >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:CoreComponentParame t > >ers-1.0" schemaLocation="UBL-CoreComponentParameters-1.0.xsd"/> > ><xsd:import > >namespace="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDataty p > >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 > > > > > > > > > -- > 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 > email: fraser.crichton@solnetsolutions.co.nz > <mailto:fraser.crichton@solnetsolutions.co.nz> > > > 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. > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]