<!--
## Versavant Topic Map Application Bus / Subject Addressing Engine v%s
## Copyright 2005 Steven R. Newcomb
## 
## This software is licensed under the Apache License, Version 2.0 
## (the "License"); you may not use this file except in compliance 
## with the License.  Copies of the License are available at       
##        http://www.apache.org/licenses/LICENSE-2.0               
## Unless required by applicable law or agreed to in writing,      
## software distributed under the License is distributed on an "AS 
## IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
## express or implied.  See the License for the specific language  
## governing permissions and limitations under the License.        
##                                                                 
## Copies of the source code and the license are available at      
##        http://www.versavant.org                                 

####################################
cvsRevision = "$Revision: 1.5 $" ##
####################################

-->

<!-- Versavant TMAConfigFile.dtd.  -->

<!-- Instances of this DTD are used to disclose (i.e., configure and
     document) Topic Map Applications (TMAs), using the Versavant TMA
     disclosure discipline.  Implementation of this discipline, such
     as vrsvnt.py, can read these instances and prepare topic maps to
     have subject proxies added to them whose properties 
     are governed by the TMA being disclosed. -->

<!-- In instances of this DTD, references to environment variables
     found in the values of functionModuleFilePath variables are
     subject to substitution in the usual (shell-style) way.  For
     example, if HOME is an environment variable, the strings
     '${HOME}' and '$HOME' are substituted for the current value of
     the HOME environment variable.  If HOME is not an environment
     variable, then $HOME and ${HOME} are left unchanged. -->

<!-- The order in which elements appear is significant within each
     element type, but nonsignificant across element types.  First,
     all <ValueType> elements will be registered, in the order
     encountered, then all <PropertyClass> elements will be
     registered, in the order encountered, and finally all
     <ConferralRule> elements will be registered, in the order
     encountered.  (It's really only important that the value types be
     registered before the property classes, but, anyway, that's the
     order of operations.)  Registration order determines execution
     order. (Which really shouldn't make any difference to the
     resulting topic map, but may have some impact on the efficiency
     of the processing required to get the result.)  -->

<!-- Document element -->
<!ELEMENT VersavantTMA ( Desc?, ( ValueType | PropertyClass | ConferralRule)+)>
<!ATTLIST VersavantTMA
    VersavantTMADTDVersion       CDATA    #REQUIRED
>

<!-- Register an implementation of a value type -->

<!-- System default implementation functions will be used for missing
     function elements.  (The names of all function element types have
     two underscores in them.) -->

<!-- The Desc elements are optional, but their use is strongly
     recommended.  Each one should describe and disclose the
     intentions and theories (if any) that underlie the
     implementations of the TMAs, value types, property classes, and
     conferral rules that correspond to the elements (VersavantTMA,
     ValueType, PropertyClass, and ConferralRule) that contain the
     Desc elements. -->

<!ELEMENT ValueType ( 
                      Desc?,
                      ValueIsNotOfType__?,
                      InstanceOf__ValueTypeToXMLContentString?,
                      XMLContentStringToInstanceOf__ValueType?
                    )>
<!ATTLIST ValueType
    ValueTypeName           CDATA     #REQUIRED
>

<!ELEMENT ValueIsNotOfType__ EMPTY>
<!ATTLIST ValueIsNotOfType__ 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>

<!ELEMENT InstanceOf__ValueTypeToXMLContentString EMPTY>
<!ATTLIST InstanceOf__ValueTypeToXMLContentString 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>

<!ELEMENT XMLContentStringToInstanceOf__ValueType EMPTY>
<!ATTLIST XMLContentStringToInstanceOf__ValueType 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>

<!-- Register an implementation of a property class. -->
<!-- System default implementation functions will be used for
     unspecified content elements. -->
<!ELEMENT PropertyClass ( 
                          Desc?,
                          Add__PropToOverheadDict?,
                          Remove__PropFromOverheadDict?,
                          ValueIsInvalidFor__Property?,
                          Merge__PropertyValues?,
                          ValuesOf__PropertyInstancesAreSignificantlyDifferent?,
                          ContextOf__PropertyIsInvalid?,
                          MergeProxiesBecause__PropertyInstancesSpecifySameSubject?,
                          ProxiesOfSubjectIdentifiedBy__Value?,
                          UpdateProxyReferencesIn__Value?
                        )>
<!ATTLIST PropertyClass
    PropertyClassName        CDATA    #REQUIRED
    ValueType                CDATA    #REQUIRED
>

<!ELEMENT Add__PropToOverheadDict EMPTY>
<!ATTLIST Add__PropToOverheadDict 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT Remove__PropFromOverheadDict EMPTY>
<!ATTLIST Remove__PropFromOverheadDict 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT ValueIsInvalidFor__Property EMPTY>
<!ATTLIST ValueIsInvalidFor__Property 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT Merge__PropertyValues EMPTY>
<!ATTLIST Merge__PropertyValues 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT ValuesOf__PropertyInstancesAreSignificantlyDifferent EMPTY>
<!ATTLIST ValuesOf__PropertyInstancesAreSignificantlyDifferent 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT ContextOf__PropertyIsInvalid EMPTY>
<!ATTLIST ContextOf__PropertyIsInvalid 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT MergeProxiesBecause__PropertyInstancesSpecifySameSubject EMPTY>
<!ATTLIST MergeProxiesBecause__PropertyInstancesSpecifySameSubject 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT ProxiesWith__ValueNotSignificantlyDifferentFrom EMPTY>
<!ATTLIST ProxiesWith__ValueNotSignificantlyDifferentFrom 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>
<!ELEMENT UpdateProxyReferencesIn__Value EMPTY>
<!ATTLIST UpdateProxyReferencesIn__Value 
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>


<!-- Register an implementation of a conferral rule. -->
<!ELEMENT ConferralRule ( Desc?)>
<!ATTLIST ConferralRule
    ConferralRuleName        CDATA #REQUIRED
    functionModuleFilePath   CDATA #REQUIRED
    functionName             CDATA #REQUIRED
    functionExtraArgsString  CDATA ""
>

<!-- Human readable description/disclosure of the TMA, value type,
     property class, or conferral rule that corresponds to the containing
     VersavantTMA, ValueType, PropertyClass, or ConferralRule element.-->

<!ELEMENT Desc (#PCDATA)>

