OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

codelist-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [codelist-comment] Code list integration with program


These are good questions ... thanks for asking them.

At 2010-05-11 11:42 -0700, ericdes wrote:
>Here's my problem: In the case you want to limit the buyers to be 
>either Canadian or US-based,
>- you create a country code list that restricts the choice to both 
>countries (OK)
>- and you create 2 lists of country sub-entity codes, one for the 
>Canadian provinces and one for the US states. (OK)
>- and the corresponding CVA file. (OK)
>
>(1) How do you check that the state of Texas shouldn't be used when 
>the buyer is in Canada. (I guess through a Schematron rule?)

Or by adding predicates to the context for each code list:

     <Context address="cbc:CountrySubentityCode
                       [../cac:Country/cbc:IdentificationCode='US']"
              values="states"
              metadata="cctsV2.01-code">
       <Annotation>
         <Description>
           States can only be in the US.
         </Description>
       </Annotation>
       <Message>Invalid state '<sch:value-of select="."/>' for 
"<sch:value-of select="ancestor::cac:Party/cac:PartyName/cbc:Name"/>"</Message>
     </Context>
     <Context address="cbc:CountrySubentityCode
                       [../cac:Country/cbc:IdentificationCode='CA']"
              values="provinces"
              metadata="cctsV2.01-code">
       <Annotation>
         <Description>
           Provinces can only be in Canada.
         </Description>
       </Annotation>
       <Message>Invalid province '<sch:value-of select="."/>' for 
"<sch:value-of select="ancestor::cac:Party/cac:PartyName/cbc:Name"/>"</Message>
     </Context>

The above two contexts do not conflict because the predicates are 
mutually exclusive.

>(2) And most importantly, how a program could interact with a code 
>list (and with a code list only) to display a list of US states when 
>the country selected is the US, and a list of Canadian states when a 
>Canadian address is entered? Is this at all possible, desirable? to 
>rely on a code list to govern the GUI?

That is up to how you write your program.  Remember that CVA and 
genericode files are used to convey code list information from point 
A to point B.  One then assimilates the information from these files 
into their programs, such that the program has the appropriate data 
structures with which to do its job.  When using XML there is no 
obligation on those who send or receive the angle brackets to 
actually use the angle brackets in their program logic ... only in 
their program interfaces.

So, yes, code lists *govern* the GUI, but only so far as to inform 
the GUI what needs to be done.  The GUI interaction need only know 
what was conveyed by the code list files, they need not interact with 
the code list files at run time.

Thank you again for the questions ... keep 'em coming!

I hope this helps.

. . . . . . . . . . . Ken


--
XSLT/XQuery training:   after http://XMLPrague.cz 2011-03-28/04-01
Vote for your XML training:   http://www.CraneSoftwrights.com/c/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/c/
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/c/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]