[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: Checking Enumerative QNames for the TAML-defined simple values
Yep, it does work - see latest schema (TAML v1.0.0.3) http://www.oasis-open.org/committees/download.php/35196/testAssertionMarkupLanguage-1-0-0-3.xsd This is an example of a schema-valid prescription level custom extension enumerated value: <testAssertion xmlns="http://docs.oasis-open.org/tag/taml/200911" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:abc="abc" xsi:schemaLocation="http://docs.oasis-open.org/tag/taml/200911 http://www.oasis-open.org/committees/download.php/35196/testAssertionMarkupLanguage-1-0-0-3.xsd" id="illustation-1-0" schemaVersionId="1.0.0.3" time="08:39:23.312" date="2009-11-30"> <prescription level="abc:deprecated"/> </testAssertion> abc:deprecated is only valid because the namespace/prefix is declared Also valid is: <testAssertion xmlns="http://docs.oasis-open.org/tag/taml/200911" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/tag/taml/200911 http://www.oasis-open.org/committees/download.php/35196/testAssertionMarkupLanguage-1-0-0-3.xsd" id="illustation-1-0" schemaVersionId="1.0.0.3" time="08:39:23.312" date="2009-11-30"> <prescription level="abc:deprecated" xmlns:abc="abc"/> </testAssertion> where the prexix/namespace is declared more locally in the prescription element. Works - as long as people use it properly. I note though that the following is also valid (without a prefix): <testAssertion xmlns="http://docs.oasis-open.org/tag/taml/200911" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/tag/taml/200911 http://www.oasis-open.org/committees/download.php/35196/testAssertionMarkupLanguage-1-0-0-3.xsd" id="illustation-1-0" schemaVersionId="1.0.0.3" time="08:39:23.312" date="2009-11-30"> <prescription level="deprecated"/> </testAssertion> because of XML Schema rules, so the namespace prefix is optional. I'm not expert enough to know for sure why this is but I guess it might be because the attribute itself does not need a namespace declaration; something to do with it automatically taking the default namespace?? Anyway, that it a bit too geeky for me to worry me. Just suffice that the namespace and prefix happen to be optional. The side effect of that is that folk have to be aware that the schema will not catch typos for the built-in values; i.e. <testAssertion xmlns="http://docs.oasis-open.org/tag/taml/200911" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/tag/taml/200911 http://www.oasis-open.org/committees/download.php/35196/testAssertionMarkupLanguage-1-0-0-3.xsd" id="illustation-1-0" schemaVersionId="1.0.0.3" time="08:39:23.312" date="2009-11-30"> <prescription level="mandatoyr"/> </testAssertion> is valid with a typo in the value 'mandatory' ('mandatoyr'). The schema does not reject it. But XML editor tools will offer the correct values when provided with the schema if they have intellisense functonality. That could be important for many, though I take your point that we do not know that people will use XML editors to handwrite test assertions: for me at least, though, it is definitely something I will need to do (e.g. to write TAs for business legal documents like the UBL Invoice). I'm quite happy with this because of your point that this may encourage people to give their extension of the codelists a namespace and therefore perhaps one which resolves to some documentation (e.g. a genericode list or an RDF 'resource') or that the namespace might be documented some other way. I'm not sure there is more to it than that though. It does seem to be catching on at the moment as a way to enumerate content. Best regards --- Stephen D Green 2009/11/15 Dennis E. Hamilton <dennis.hamilton@acm.org>: > I'm not much of a schema head, but I think you can do what you want in a > modestly-awkward way. > > 1. For the QNames, the only permitted form for open-ended extensions have a > ":" in them somewhere. Other than those, the only permitted ones should be > the (unprefixed) ones we define as part of the TAML specification. > > 2. You might have to do a Union to make it work. That is have a QName where > a ":" is required. Then union with an NCName restricted to the literal > values that are defined in the TAML specification. > > 3. This is only awkward because each restricted enumerated-attribute value > that is extensible with PrefixedNames has its plain values restricted > independently, so we can't use a new derived type to handle this. > > Does this work for you? > > - Dennis > > PS: I don't talk about typos because there is no way to distinguish between > a typo, a non-conformant document, and an up-level document being attempted > by a processor using a down-level schema. They all look like documents that > don't satisfy the schema. Processors might be creative about helping users > find errors and recognize their causes. I would be amazed if anyone went > very far with this for TAML. > > -----Original Message----- > From: stephengreenubl@gmail.com [mailto:stephengreenubl@gmail.com] On Behalf > Of Stephen Green > http://lists.oasis-open.org/archives/tag/200911/msg00059.html > Sent: Sunday, November 15, 2009 00:53 > To: dennis.hamilton@acm.org > Cc: TAG TC List > Subject: Re: [tag] Re: Considerations for TAML Authoring and > normalizedString > > [ ... ] > > There is still an issue that typos in the existing built-in codes > won't be picked up by the schema - they will still be acceptable > as QNames without a prefix. > > [ ... ] > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]