Changeset 3458


Ignore:
Timestamp:
08/22/13 12:45:39 (11 years ago)
Author:
mwindhouwer
Message:

M mod-ISOcat-access-data/dbx/DCIF.xml

  • caches DCIF per DC
  • removed inclusion of rank info, so search results can use cached DCIF

M mod-ISOcat-access-data/access/dc_touch.acc

  • remove the cache entry for a DC

M mod-ISOcat-access-data/access/dcs_to_dcif.acc

  • added postprocessing to add rank info if available and requested

M mod-ISOcat-access-data/access/dc_update.acc

  • reformatting
Location:
cats/ISOcat/trunk/mod-ISOcat-access-data
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cats/ISOcat/trunk/mod-ISOcat-access-data/access/dc_touch.acc

    r2724 r3458  
    1 <accessor debug="false">
     1<accessor debug="true">
    22        <name>ISOcat.access.data.dc.touch</name>
    33        <descr>Touch a DC.</descr>
     
    4343                                <type>sloot.cutGoldenThread</type>
    4444                                <param>var:thread</param>
     45                        </instr>
     46                        <!-- delete a cache for the DC -->
     47                        <instr>
     48                                <type>sloot.xquery</type>
     49                                <operator>
     50                                        <string>/dc/{string($dc)}</string>
     51                                </operator>
     52                                <dc>var:dc</dc>
     53                                <target>var:cache</target>
     54                        </instr>
     55                        <instr>
     56                                <type>sloot.dbx-cache</type>
     57                                <entry>var:cache</entry>
     58                                <target>var:cache</target>
     59                        </instr>
     60                        <instr>
     61                                <type>log</type>
     62                                <operand>var:cache</operand>
    4563                        </instr>
    4664                        <!-- (re)check the DC -->
  • cats/ISOcat/trunk/mod-ISOcat-access-data/access/dc_update.acc

    r2724 r3458  
    194194                        </instr>
    195195                </accessor-debug>
    196 
     196               
     197                <!-- determine the direction of the DC check propagation -->
     198                <instr>
     199                        <type>sloot.xquery</type>
     200                        <operator>
     201                                <string xmlns:dcif="http://www.isocat.org/ns/dcif">{if ($dc/dcif:dataCategorySelection/dcif:dataCategory/@type='simple') then ('up') else ('down')}</string>
     202                        </operator>
     203                        <dc>var:dc</dc>
     204                        <target>var:dir</target>
     205                </instr>
     206               
     207                <!-- touch the updated DC -->
     208                <instr>
     209                        <type>ISOcat.access.data.dc.touch</type>
     210                        <dc>var:id</dc>
     211                        <check>var:check</check>
     212                        <dir>var:dir</dir>
     213                        <target>var:void</target>
     214                </instr>
     215               
    197216                <!-- get the updated DCIF -->
    198217                <instr>
     
    212231                </accessor-debug>
    213232               
    214                 <!-- determine the direction of the DC check propagation -->
    215                 <instr>
    216                         <type>sloot.xquery</type>
    217                         <operator>
    218                                 <string xmlns:dcif="http://www.isocat.org/ns/dcif">{if ($dc/dcif:dataCategorySelection/dcif:dataCategory/@type='simple') then ('up') else ('down')}</string>
    219                         </operator>
    220                         <dc>var:response</dc>
    221                         <target>var:dir</target>
    222                 </instr>
    223                 <!-- touch the updated DC -->
    224                 <instr>
    225                         <type>ISOcat.access.data.dc.touch</type>
    226                         <dc>var:id</dc>
    227                         <check>var:check</check>
    228                         <dir>var:dir</dir>
    229                         <target>var:void</target>
    230                 </instr>
    231 
    232233                <!-- a nice log message -->
    233234                <instr>
     
    240241                                        <xsl:template match="text()"/>
    241242                                        <xsl:template match="/dcif:dataCategorySelection/dcif:dataCategory">
    242                                                 <msg>INF: <xsl:value-of select="current-dateTime()"/>: updated
    243                                                                 DC[<xsl:value-of select="@isocat:id"/>][<xsl:value-of
     243                                                <msg>INF: <xsl:value-of select="current-dateTime()"/>: updated DC[<xsl:value-of select="@isocat:id"/>][<xsl:value-of
    244244                                                                select="@isocat:owner"/>-<xsl:value-of
    245245                                                                select="dcif:administrationInformationSection/dcif:administrationRecord/dcif:identifier"
  • cats/ISOcat/trunk/mod-ISOcat-access-data/access/dcs_to_dcif.acc

    r2705 r3458  
    197197                        <instr>
    198198                                <type>log</type>
     199                                <operand>this:response</operand>
     200                        </instr>
     201                </accessor-debug>
     202                <accessor-debug>
     203                        <instr>
     204                                <type>log</type>
    199205                                <operand>var:cleanup</operand>
    200206                        </instr>
     
    247253                                </instr>
    248254                        </then>
     255                        <cond>
     256                                <instr>
     257                                        <type>sloot.xpath2eval</type>
     258                                        <operand>var:dcs</operand>
     259                                        <operator>
     260                                                <xpath>exists(/dcs/dc/@rank)</xpath>
     261                                        </operator>
     262                                        <target>this:cond</target>
     263                                </instr>
     264                        </cond>
     265                        <then>
     266                                <accessor-debug>
     267                                        <instr>
     268                                                <type>sloot.debug</type>
     269                                                <debug>var:accessor-debug</debug>
     270                                                <operand>
     271                                                        <msg>DBG: Adding ranking info to the DCIF</msg>
     272                                                </operand>
     273                                        </instr>
     274                                </accessor-debug>
     275                                <instr>
     276                                        <type>xslt2</type>
     277                                        <operand>this:response</operand>
     278                                        <operator>
     279                                                <xsl:stylesheet
     280                                                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     281                                                        version="2.0"
     282                                                        xmlns:dcif="http://www.isocat.org/ns/dcif"
     283                                                        xmlns:dcr="http://www.isocat.org/ns/dcr"
     284                                                        xmlns:isocat="http://www.isocat.org/"
     285                                                >
     286                                                        <xsl:output method="xml" encoding="utf-8"/>
     287                                                        <xsl:param name="ranks"/>
     288                                                        <xsl:template match="dcif:dataCategory">
     289                                                                <xsl:copy>
     290                                                                        <xsl:attribute name="isocat:rank" select="$ranks//dc[@ref=current()/@isocat:id]/@rank"/>
     291                                                                        <xsl:apply-templates select="@*|node()"/>
     292                                                                </xsl:copy>
     293                                                        </xsl:template>
     294                                                        <xsl:template match="@*|node()">
     295                                                                <xsl:copy>
     296                                                                        <xsl:apply-templates select="@*|node()"/>
     297                                                                </xsl:copy>
     298                                                        </xsl:template>
     299                                                </xsl:stylesheet>
     300                                        </operator>
     301                                        <ranks>var:dcs</ranks>
     302                                        <target>this:response</target>
     303                                </instr>
     304                        </then>
    249305                </choose>
    250306        </idoc>
  • cats/ISOcat/trunk/mod-ISOcat-access-data/dbx/DCIF.xml

    r2612 r3458  
    2424       
    2525        <dbx:variable name="keyset" select="$dcs/dcs/dc/@ref"/>
    26         <dbx:variable name="rankset" select="$dcs/dcs/dc/@rank"/>
    2726
    2827        <dbx:variable name="suppress-query" when="$suppress-context-type='profile' or $suppress-context-type='dcs'" query="
     
    313312       
    314313        <dbx:process>
    315                 <dcif:dataCategorySelection dcif-version="1.2" xmlns:isocat="http://www.isocat.org/">
     314                <dcif:dataCategorySelection dcif-version="1.2" xmlns:isocat="http://www.isocat.org/" xmlns:xi="http://www.w3.org/2001/XInclude">
    316315                        <dbx:choose>
    317316                                <dbx:when test="exists($name) and (normalize-space($name)!='')">
     
    332331                        </dbx:choose>
    333332                        <dbx:for-each select="$keyset" as="key" min="0" max="*">
    334                                 <dbx:variable name="rank" select="$rankset[$key-pos]"/>
    335333                                <dbx:for-each table="core_data_category" min="1" max="1">
    336334                                        <dbx:where field="id" select="$key" type="integer"/>
    337                                         <dcif:dataCategory isocat:id="{$current/id}" isocat:identifier="{$current/identifier}" isocat:name="{$current/name}" isocat:owner_id="{$current/owner}" dcr:datcat="http://www.isocat.org/datcat/DC-48">
    338                                                 <dbx:for-each table="core_user" min="0" max="1">
    339                                                         <dbx:where field="id" select="$current/owner" type="integer"/>
    340                                                         <dbx:attribute name="isocat:owner" select="if (normalize-space($current/last_name)!='') then (if (normalize-space($current/first_name)!='') then (concat($current/last_name,', ',$current/first_name)) else ($current/last_name)) else ($current/login)"/>
    341                                                         <dbx:attribute name="isocat:owner_forum" field="forum" when="normalize-space(@*:owner_forum)!=''"/>
    342                                                 </dbx:for-each>
    343                                                 <dbx:for-each table="core_thematic_domain_group" min="0" max="1">
    344                                                         <dbx:where field="id" select="$current/owner" type="integer"/>
    345                                                         <dbx:attribute name="isocat:owner" select="concat('TDG: ',$current/name)"/>
    346                                                 </dbx:for-each>
    347                                                 <dbx:attribute name="isocat:type" field="type"/>
    348                                                 <dbx:choose>
    349                                                         <dbx:when test="$current/type='simple'">
    350                                                                 <dbx:attribute name="type" value="simple"/>
    351                                                         </dbx:when>
    352                                                         <dbx:when test="exists(index-of(('open','constrained','closed'),$current/type))">
    353                                                                 <dbx:attribute name="type" value="complex"/>
    354                                                         </dbx:when>
    355                                                         <dbx:when test="$current/type='container'">
    356                                                                 <dbx:attribute name="type" value="container"/>
    357                                                         </dbx:when>
    358                                                         <dbx:otherwise>
    359                                                                 <dbx:attribute name="type" value="unknown"/>
    360                                                         </dbx:otherwise>
    361                                                 </dbx:choose>
    362                                                 <dbx:attribute name="pid" field="pid"/>
    363                                                 <dbx:choose>
    364                                                         <dbx:when test="$current/private='true'">
    365                                                                 <dbx:attribute name="isocat:scope" value="private"/>
    366                                                         </dbx:when>
    367                                                         <dbx:otherwise>
    368                                                                 <dbx:attribute name="isocat:scope" value="public"/>
    369                                                         </dbx:otherwise>
    370                                                 </dbx:choose>
    371                                                 <dbx:choose>
    372                                                         <dbx:when test="exists($rank)">
    373                                                                 <dbx:attribute name="isocat:rank" select="$rank"/>
    374                                                         </dbx:when>
    375                                                 </dbx:choose>
    376                                                 <dbx:choose>
    377                                                         <dbx:when test="$mode!='all'">
    378                                                                 <dbx:call-template name="data_category-summary"/>
    379                                                         </dbx:when>
    380                                                 </dbx:choose>
    381                                                 <dbx:call-template name="data_category-lineage"/>
    382                                                 <dbx:for-each table="core_recommendation" min="0" max="*">
    383                                                         <dbx:where field="dc" select="$key" type="integer"/>
    384                                                         <dbx:for-each table="core_adhoc_group" min="0" max="1">
    385                                                                 <dbx:where field="id" select="$current/group" type="integer"/>
    386                                                                 <isocat:recommendedBy id="{$current/id}" dbx:field="name"/>
     335                                        <dbx:cache id="/dc/{$key}/DCIF-M-{$mode}-S-{$suppress}-{$suppress-context-type}-{$suppress-context}-P-{string-join($profiles,'-')}-WL-{string-join($working-languages,'-')}-OL-{string-join($object-languages,'-')}-X-{$parse-xml-constraints}">
     336                                                <dcif:dataCategory isocat:id="{$current/id}" isocat:identifier="{$current/identifier}" isocat:name="{$current/name}" isocat:owner_id="{$current/owner}" dcr:datcat="http://www.isocat.org/datcat/DC-48">
     337                                                        <dbx:for-each table="core_user" min="0" max="1">
     338                                                                <dbx:where field="id" select="$current/owner" type="integer"/>
     339                                                                <dbx:attribute name="isocat:owner" select="if (normalize-space($current/last_name)!='') then (if (normalize-space($current/first_name)!='') then (concat($current/last_name,', ',$current/first_name)) else ($current/last_name)) else ($current/login)"/>
     340                                                                <dbx:attribute name="isocat:owner_forum" field="forum" when="normalize-space(@*:owner_forum)!=''"/>
    387341                                                        </dbx:for-each>
    388342                                                        <dbx:for-each table="core_thematic_domain_group" min="0" max="1">
    389                                                                 <dbx:where field="id" select="$current/group" type="integer"/>
    390                                                                 <isocat:recommendedBy id="{$current/id}">
    391                                                                         <dbx:value-of select="concat('TDG: ',$current/name)"/>
    392                                                                 </isocat:recommendedBy>
     343                                                                <dbx:where field="id" select="$current/owner" type="integer"/>
     344                                                                <dbx:attribute name="isocat:owner" select="concat('TDG: ',$current/name)"/>
    393345                                                        </dbx:for-each>
    394                                                 </dbx:for-each>
    395                                                 <dbx:choose>
    396                                                         <dbx:when test="$mode='all'">
    397                                                                 <dcif:administrationInformationSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-51">
    398                                                                         <dcif:administrationRecord isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-52">
    399                                                                                 <dcif:identifier dbx:field="identifier" dcr:datcat="http://www.isocat.org/datcat/DC-8"/>
    400                                                                                 <dcif:version dbx:field="version" dcr:datcat="http://www.isocat.org/datcat/DC-2400">
    401                                                                                         <dbx:attribute name="isocat:branch" field="branch"/>
    402                                                                                         <dbx:attribute name="isocat:revision" field="revision"/>
    403                                                                                         <dbx:attribute name="isocat:sidebranches" field="sidebranches"/>
    404                                                                                 </dcif:version>
    405                                                                                 <dcif:registrationStatus dcr:datcat="http://www.isocat.org/datcat/DC-21" dbx:field="registration_status">
    406                                                                                         <dbx:choose>
    407                                                                                                 <dbx:when test="$current/registration_status='candidate'">
    408                                                                                                         <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-24"/>
    409                                                                                                 </dbx:when>
    410                                                                                                 <dbx:when test="$current/registration_status='standard'">
    411                                                                                                         <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-22"/>
    412                                                                                                 </dbx:when>
    413                                                                                                 <dbx:when test="$current/registration_status='deprecated'">
    414                                                                                                         <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-2401"/>
    415                                                                                                 </dbx:when>
    416                                                                                                 <dbx:when test="$current/registration_status='superseded'">
    417                                                                                                         <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-26"/>
    418                                                                                                 </dbx:when>
    419                                                                                         </dbx:choose>
    420                                                                                 </dcif:registrationStatus>
    421                                                                                 <isocat:administrationStatus dcr:datcat="http://www.isocat.org/datcat/DC-2" dbx:field="administration_status"/>
    422                                                                                 <dcif:justification  dbx:field="justification" dcr:datcat="http://www.isocat.org/datcat/DC-2410"  dbx:when="normalize-space(.)!=''"/>
    423                                                                                 <dbx:for-each table="generic_text" min="0" max="*">
     346                                                        <dbx:attribute name="isocat:type" field="type"/>
     347                                                        <dbx:choose>
     348                                                                <dbx:when test="$current/type='simple'">
     349                                                                        <dbx:attribute name="type" value="simple"/>
     350                                                                </dbx:when>
     351                                                                <dbx:when test="exists(index-of(('open','constrained','closed'),$current/type))">
     352                                                                        <dbx:attribute name="type" value="complex"/>
     353                                                                </dbx:when>
     354                                                                <dbx:when test="$current/type='container'">
     355                                                                        <dbx:attribute name="type" value="container"/>
     356                                                                </dbx:when>
     357                                                                <dbx:otherwise>
     358                                                                        <dbx:attribute name="type" value="unknown"/>
     359                                                                </dbx:otherwise>
     360                                                        </dbx:choose>
     361                                                        <dbx:attribute name="pid" field="pid"/>
     362                                                        <dbx:choose>
     363                                                                <dbx:when test="$current/private='true'">
     364                                                                        <dbx:attribute name="isocat:scope" value="private"/>
     365                                                                </dbx:when>
     366                                                                <dbx:otherwise>
     367                                                                        <dbx:attribute name="isocat:scope" value="public"/>
     368                                                                </dbx:otherwise>
     369                                                        </dbx:choose>
     370                                                        <dbx:choose>
     371                                                                <dbx:when test="$mode!='all'">
     372                                                                        <dbx:call-template name="data_category-summary"/>
     373                                                                </dbx:when>
     374                                                        </dbx:choose>
     375                                                        <dbx:call-template name="data_category-lineage"/>
     376                                                        <dbx:for-each table="core_recommendation" min="0" max="*">
     377                                                                <dbx:where field="dc" select="$key" type="integer"/>
     378                                                                <dbx:for-each table="core_adhoc_group" min="0" max="1">
     379                                                                        <dbx:where field="id" select="$current/group" type="integer"/>
     380                                                                        <isocat:recommendedBy id="{$current/id}" dbx:field="name"/>
     381                                                                </dbx:for-each>
     382                                                                <dbx:for-each table="core_thematic_domain_group" min="0" max="1">
     383                                                                        <dbx:where field="id" select="$current/group" type="integer"/>
     384                                                                        <isocat:recommendedBy id="{$current/id}">
     385                                                                                <dbx:value-of select="concat('TDG: ',$current/name)"/>
     386                                                                        </isocat:recommendedBy>
     387                                                                </dbx:for-each>
     388                                                        </dbx:for-each>
     389                                                        <dbx:choose>
     390                                                                <dbx:when test="$mode='all'">
     391                                                                        <dcif:administrationInformationSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-51">
     392                                                                                <dcif:administrationRecord isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-52">
     393                                                                                        <dcif:identifier dbx:field="identifier" dcr:datcat="http://www.isocat.org/datcat/DC-8"/>
     394                                                                                        <dcif:version dbx:field="version" dcr:datcat="http://www.isocat.org/datcat/DC-2400">
     395                                                                                                <dbx:attribute name="isocat:branch" field="branch"/>
     396                                                                                                <dbx:attribute name="isocat:revision" field="revision"/>
     397                                                                                                <dbx:attribute name="isocat:sidebranches" field="sidebranches"/>
     398                                                                                        </dcif:version>
     399                                                                                        <dcif:registrationStatus dcr:datcat="http://www.isocat.org/datcat/DC-21" dbx:field="registration_status">
     400                                                                                                <dbx:choose>
     401                                                                                                        <dbx:when test="$current/registration_status='candidate'">
     402                                                                                                                <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-24"/>
     403                                                                                                        </dbx:when>
     404                                                                                                        <dbx:when test="$current/registration_status='standard'">
     405                                                                                                                <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-22"/>
     406                                                                                                        </dbx:when>
     407                                                                                                        <dbx:when test="$current/registration_status='deprecated'">
     408                                                                                                                <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-2401"/>
     409                                                                                                        </dbx:when>
     410                                                                                                        <dbx:when test="$current/registration_status='superseded'">
     411                                                                                                                <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-26"/>
     412                                                                                                        </dbx:when>
     413                                                                                                </dbx:choose>
     414                                                                                        </dcif:registrationStatus>
     415                                                                                        <isocat:administrationStatus dcr:datcat="http://www.isocat.org/datcat/DC-2" dbx:field="administration_status"/>
     416                                                                                        <dcif:justification  dbx:field="justification" dcr:datcat="http://www.isocat.org/datcat/DC-2410"  dbx:when="normalize-space(.)!=''"/>
     417                                                                                        <dbx:for-each table="generic_text" min="0" max="*">
     418                                                                                                <dbx:where field="owner" select="$current/id" type="integer"/>
     419                                                                                                <dbx:where field="owner_type" value="data category"       type="string"/>
     420                                                                                                <dbx:where field="text_type"  value="administration note" type="string"/>
     421                                                                                                <isocat:administrationNote isocat:id="{$current/id}" dbx:field="text">
     422                                                                                                        <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     423                                                                                                </isocat:administrationNote>
     424                                                                                        </dbx:for-each>
     425                                                                                        <dcif:origin dbx:field="origin" dcr:datcat="http://www.isocat.org/datcat/DC-19" dbx:when="normalize-space(.)!=''"/>
     426                                                                                        <dbx:for-each table="generic_text" min="0" max="*">
     427                                                                                                <dbx:where field="owner" select="$current/id" type="integer"/>
     428                                                                                                <dbx:where field="owner_type" value="data category"       type="string"/>
     429                                                                                                <dbx:where field="text_type"  value="explanatory comment" type="string"/>
     430                                                                                                <dcif:explanatoryComment isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-7">
     431                                                                                                        <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     432                                                                                                </dcif:explanatoryComment>
     433                                                                                        </dbx:for-each>
     434                                                                                        <dbx:for-each table="generic_text" min="0" max="*">
     435                                                                                                <dbx:where field="owner" select="$current/id" type="integer"/>
     436                                                                                                <dbx:where field="owner_type" value="data category"    type="string"/>
     437                                                                                                <dbx:where field="text_type"  value="unresolved issue" type="string"/>
     438                                                                                                <dcif:unresolvedIssue isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-29">
     439                                                                                                        <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     440                                                                                                </dcif:unresolvedIssue>
     441                                                                                        </dbx:for-each>
     442                                                                                        <dcif:effectiveDate dbx:field="effective_date" dcr:datcat="http://www.isocat.org/datcat/DC-6" dbx:when="normalize-space(.)!=''"/>
     443                                                                                        <dcif:untilDate dbx:field="until_date" dcr:datcat="http://www.isocat.org/datcat/DC-30" dbx:when="normalize-space(.)!=''"/>
     444                                                                                        <dbx:for-each table="generic_text" min="1" max="*">
     445                                                                                                <dbx:where field="owner" select="$current/id" type="integer"/>
     446                                                                                                <dbx:where field="owner_type" value="data category" type="string"/>
     447                                                                                                <dbx:where field="text_type"  value="change"        type="string"/>
     448                                                                                                <dbx:sort field="timestamp" order="ascending"/>
     449                                                                                                <dbx:choose>
     450                                                                                                        <dbx:when test="$current-pos = 1">
     451                                                                                                                <dcif:creation isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2398">
     452                                                                                                                        <dcif:creationDate dbx:field="date" dcr:datcat="http://www.isocat.org/datcat/DC-5"/>
     453                                                                                                                        <dcif:changeDescription dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-3">
     454                                                                                                                                <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     455                                                                                                                        </dcif:changeDescription>
     456                                                                                                                </dcif:creation>
     457                                                                                                        </dbx:when>
     458                                                                                                        <dbx:when test="($current-size > 1) and ($current-pos = $current-size)">
     459                                                                                                                <dcif:lastChange isocat:id="{$current/id}"  dcr:datcat="http://www.isocat.org/datcat/DC-2399">
     460                                                                                                                        <dcif:lastChangeDate dbx:field="date" dcr:datcat="http://www.isocat.org/datcat/DC-9"/>
     461                                                                                                                        <dcif:changeDescription dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-3">
     462                                                                                                                                <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     463                                                                                                                        </dcif:changeDescription>
     464                                                                                                                </dcif:lastChange>
     465                                                                                                        </dbx:when>
     466                                                                                                </dbx:choose>
     467                                                                                                <isocat:change isocat:id="{$current/id}">
     468                                                                                                        <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     469                                                                                                        <dbx:attribute name="timestamp" field="timestamp"/>
     470                                                                                                        <dbx:value-of field="text"/>
     471                                                                                                </isocat:change>
     472                                                                                        </dbx:for-each>
     473                                                                                </dcif:administrationRecord>
     474                                                                        </dcif:administrationInformationSection>
     475                                                                </dbx:when>
     476                                                        </dbx:choose>
     477                                                        <dbx:choose>
     478                                                                <dbx:when test="$mode='all' ">
     479                                                                        <dcif:descriptionSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-49">
     480                                                                                <dbx:for-each table="link_profile_members" min="1" max="*">
     481                                                                                        <dbx:where field="dc" select="$current/id"/>
     482                                                                                        <dbx:variable name="profile" select="$current/profile"/>
     483                                                                                        <dbx:variable name="member" value="true"/>
     484                                                                                        <dbx:call-template name="profile-trail"/>
     485                                                                                </dbx:for-each>
     486                                                                                <dbx:for-each table="generic_name" min="0" max="*">
    424487                                                                                        <dbx:where field="owner" select="$current/id" type="integer"/>
    425                                                                                         <dbx:where field="owner_type" value="data category"       type="string"/>
    426                                                                                         <dbx:where field="text_type"  value="administration note" type="string"/>
    427                                                                                         <isocat:administrationNote isocat:id="{$current/id}" dbx:field="text">
    428                                                                                                 <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    429                                                                                         </isocat:administrationNote>
     488                                                                                        <dbx:where field="owner_type" value="data category"     type="string"/>
     489                                                                                        <dbx:where field="name_type"  value="data element name" type="string"/>
     490                                                                                        <dbx:sort field="id"/>
     491                                                                                        <dcif:dataElementNameSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2402">
     492                                                                                                <dcif:dataElementName dbx:field="name" dcr:datcat="http://www.isocat.org/datcat/DC-56"/>
     493                                                                                                <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27"/>
     494                                                                                        </dcif:dataElementNameSection>
    430495                                                                                </dbx:for-each>
    431                                                                                 <dcif:origin dbx:field="origin" dcr:datcat="http://www.isocat.org/datcat/DC-19" dbx:when="normalize-space(.)!=''"/>
    432                                                                                 <dbx:for-each table="generic_text" min="0" max="*">
    433                                                                                         <dbx:where field="owner" select="$current/id" type="integer"/>
    434                                                                                         <dbx:where field="owner_type" value="data category"       type="string"/>
    435                                                                                         <dbx:where field="text_type"  value="explanatory comment" type="string"/>
    436                                                                                         <dcif:explanatoryComment isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-7">
    437                                                                                                 <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    438                                                                                         </dcif:explanatoryComment>
    439                                                                                 </dbx:for-each>
    440                                                                                 <dbx:for-each table="generic_text" min="0" max="*">
    441                                                                                         <dbx:where field="owner" select="$current/id" type="integer"/>
    442                                                                                         <dbx:where field="owner_type" value="data category"    type="string"/>
    443                                                                                         <dbx:where field="text_type"  value="unresolved issue" type="string"/>
    444                                                                                         <dcif:unresolvedIssue isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-29">
    445                                                                                                 <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    446                                                                                         </dcif:unresolvedIssue>
    447                                                                                 </dbx:for-each>
    448                                                                                 <dcif:effectiveDate dbx:field="effective_date" dcr:datcat="http://www.isocat.org/datcat/DC-6" dbx:when="normalize-space(.)!=''"/>
    449                                                                                 <dcif:untilDate dbx:field="until_date" dcr:datcat="http://www.isocat.org/datcat/DC-30" dbx:when="normalize-space(.)!=''"/>
    450                                                                                 <dbx:for-each table="generic_text" min="1" max="*">
    451                                                                                         <dbx:where field="owner" select="$current/id" type="integer"/>
    452                                                                                         <dbx:where field="owner_type" value="data category" type="string"/>
    453                                                                                         <dbx:where field="text_type"  value="change"        type="string"/>
    454                                                                                         <dbx:sort field="timestamp" order="ascending"/>
    455                                                                                         <dbx:choose>
    456                                                                                                 <dbx:when test="$current-pos = 1">
    457                                                                                                         <dcif:creation isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2398">
    458                                                                                                                 <dcif:creationDate dbx:field="date" dcr:datcat="http://www.isocat.org/datcat/DC-5"/>
    459                                                                                                                 <dcif:changeDescription dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-3">
    460                                                                                                                         <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    461                                                                                                                 </dcif:changeDescription>
    462                                                                                                         </dcif:creation>
    463                                                                                                 </dbx:when>
    464                                                                                                 <dbx:when test="($current-size > 1) and ($current-pos = $current-size)">
    465                                                                                                         <dcif:lastChange isocat:id="{$current/id}"  dcr:datcat="http://www.isocat.org/datcat/DC-2399">
    466                                                                                                                 <dcif:lastChangeDate dbx:field="date" dcr:datcat="http://www.isocat.org/datcat/DC-9"/>
    467                                                                                                                 <dcif:changeDescription dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-3">
    468                                                                                                                         <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    469                                                                                                                 </dcif:changeDescription>
    470                                                                                                         </dcif:lastChange>
    471                                                                                                 </dbx:when>
    472                                                                                         </dbx:choose>
    473                                                                                         <isocat:change isocat:id="{$current/id}">
    474                                                                                                 <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    475                                                                                                 <dbx:attribute name="timestamp" field="timestamp"/>
    476                                                                                                 <dbx:value-of field="text"/>
    477                                                                                         </isocat:change>
    478                                                                                 </dbx:for-each>
    479                                                                         </dcif:administrationRecord>
    480                                                                 </dcif:administrationInformationSection>
    481                                                         </dbx:when>
    482                                                 </dbx:choose>
    483                                                 <dbx:choose>
    484                                                         <dbx:when test="$mode='all' ">
    485                                                                 <dcif:descriptionSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-49">
    486                                                                         <dbx:for-each table="link_profile_members" min="1" max="*">
    487                                                                                 <dbx:where field="dc" select="$current/id"/>
    488                                                                                 <dbx:variable name="profile" select="$current/profile"/>
    489                                                                                 <dbx:variable name="member" value="true"/>
    490                                                                                 <dbx:call-template name="profile-trail"/>
    491                                                                         </dbx:for-each>
    492                                                                         <dbx:for-each table="generic_name" min="0" max="*">
    493                                                                                 <dbx:where field="owner" select="$current/id" type="integer"/>
    494                                                                                 <dbx:where field="owner_type" value="data category"     type="string"/>
    495                                                                                 <dbx:where field="name_type"  value="data element name" type="string"/>
    496                                                                                 <dbx:sort field="id"/>
    497                                                                                 <dcif:dataElementNameSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2402">
    498                                                                                         <dcif:dataElementName dbx:field="name" dcr:datcat="http://www.isocat.org/datcat/DC-56"/>
    499                                                                                         <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27"/>
    500                                                                                 </dcif:dataElementNameSection>
    501                                                                         </dbx:for-each>
    502                                                                         <dbx:for-each table="core_language_section" min="0" max="*">
    503                                                                                 <!-- the english language section is mandatory, but you can skip it in a object language view -->
    504                                                                                 <dbx:where field="dc" select="$current/id"/>
    505                                                                                 <dbx:where field="language" operator="in" select="$working-languages//id" type="integer" when="exists($working-languages//id)"/>
    506                                                                                 <dcif:languageSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2412">
    507                                                                                         <dcif:language isocat:id="{$current/language}" isocat:direction="{$core_language//row[id=$current/language]/direction}" isocat:name="{$core_language//row[id=$current/language]/name}" dcr:datcat="http://www.isocat.org/datcat/DC-35">
    508                                                                                                 <dbx:value-of select="$core_language//row[id=$current/language]/tag"/>
    509                                                                                         </dcif:language>
    510                                                                                         <dbx:for-each table="generic_name" min="0" max="*">
    511                                                                                                 <dbx:where field="owner" select="$current/id" type="integer"/>
    512                                                                                                 <dbx:where field="owner_type" value="language section" type="string"/>
    513                                                                                                 <dbx:where field="name_type"  value="name section"     type="string"/>
    514                                                                                                 <dbx:sort field="status"/>
    515                                                                                                 <dbx:sort field="id"/>
    516                                                                                                 <dcif:nameSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-50">
    517                                                                                                         <dcif:name dbx:field="name" dcr:datcat="http://www.isocat.org/datcat/DC-11">
    518                                                                                                                 <dbx:for-each table="generic_name" min="1" max="1">
    519                                                                                                                         <dbx:where field="id" select="$current/id" type="integer"/>
    520                                                                                                                         <dbx:sort field="id"/>
     496                                                                                <dbx:for-each table="core_language_section" min="0" max="*">
     497                                                                                        <!-- the english language section is mandatory, but you can skip it in a object language view -->
     498                                                                                        <dbx:where field="dc" select="$current/id"/>
     499                                                                                        <dbx:where field="language" operator="in" select="$working-languages//id" type="integer" when="exists($working-languages//id)"/>
     500                                                                                        <dcif:languageSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2412">
     501                                                                                                <dcif:language isocat:id="{$current/language}" isocat:direction="{$core_language//row[id=$current/language]/direction}" isocat:name="{$core_language//row[id=$current/language]/name}" dcr:datcat="http://www.isocat.org/datcat/DC-35">
     502                                                                                                        <dbx:value-of select="$core_language//row[id=$current/language]/tag"/>
     503                                                                                                </dcif:language>
     504                                                                                                <dbx:for-each table="generic_name" min="0" max="*">
     505                                                                                                        <dbx:where field="owner" select="$current/id" type="integer"/>
     506                                                                                                        <dbx:where field="owner_type" value="language section" type="string"/>
     507                                                                                                        <dbx:where field="name_type"  value="name section"     type="string"/>
     508                                                                                                        <dbx:sort field="status"/>
     509                                                                                                        <dbx:sort field="id"/>
     510                                                                                                        <dcif:nameSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-50">
     511                                                                                                                <dcif:name dbx:field="name" dcr:datcat="http://www.isocat.org/datcat/DC-11">
     512                                                                                                                        <dbx:for-each table="generic_name" min="1" max="1">
     513                                                                                                                                <dbx:where field="id" select="$current/id" type="integer"/>
     514                                                                                                                                <dbx:sort field="id"/>
     515                                                                                                                                <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     516                                                                                                                                <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
     517                                                                                                                        </dbx:for-each>
     518                                                                                                                </dcif:name>
     519                                                                                                                <dcif:nameStatus dbx:field="status" dcr:datcat="http://www.isocat.org/datcat/DC-12">
     520                                                                                                                        <dbx:choose>
     521                                                                                                                                <dbx:when test="$current/status='standardized name'">
     522                                                                                                                                        <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-13"/>
     523                                                                                                                                </dbx:when>
     524                                                                                                                                <dbx:when test="$current/status='preferred name'">
     525                                                                                                                                        <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-14"/>
     526                                                                                                                                </dbx:when>
     527                                                                                                                                <dbx:when test="$current/status='admitted name'">
     528                                                                                                                                        <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-15"/>
     529                                                                                                                                </dbx:when>
     530                                                                                                                                <dbx:when test="$current/status='deprecated name'">
     531                                                                                                                                        <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-16"/>
     532                                                                                                                                </dbx:when>
     533                                                                                                                                <dbx:when test="$current/status='superseded name'">
     534                                                                                                                                        <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-17"/>
     535                                                                                                                                </dbx:when>
     536                                                                                                                        </dbx:choose>
     537                                                                                                                </dcif:nameStatus>
     538                                                                                                        </dcif:nameSection>
     539                                                                                                </dbx:for-each>
     540                                                                                                <dbx:for-each table="generic_text" min="0" max="*">
     541                                                                                                        <dbx:where field="owner" select="$current/id" type="integer"/>
     542                                                                                                        <dbx:where field="owner_type" value="language section" type="string"/>
     543                                                                                                        <dbx:where field="text_type"  value="definition"       type="string"/>
     544                                                                                                        <dbx:sort field="id"/>
     545                                                                                                        <dcif:definitionSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2413">
     546                                                                                                                <dcif:definition dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-32">
    521547                                                                                                                        <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    522548                                                                                                                        <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
     549                                                                                                                </dcif:definition>
     550                                                                                                                <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27"/>
     551                                                                                                                <dbx:for-each table="generic_text" min="0" max="1">
     552                                                                                                                        <dbx:where field="owner" select="$current/id" type="integer"/>
     553                                                                                                                        <dbx:where field="owner_type" value="text" type="string"/>
     554                                                                                                                        <dbx:where field="text_type"  value="note" type="string"/>
     555                                                                                                                        <dbx:sort field="id"/>
     556                                                                                                                        <dcif:note isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-36">
     557                                                                                                                                <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     558                                                                                                                                <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
     559                                                                                                                        </dcif:note>
    523560                                                                                                                </dbx:for-each>
    524                                                                                                         </dcif:name>
    525                                                                                                         <dcif:nameStatus dbx:field="status" dcr:datcat="http://www.isocat.org/datcat/DC-12">
    526                                                                                                                 <dbx:choose>
    527                                                                                                                         <dbx:when test="$current/status='standardized name'">
    528                                                                                                                                 <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-13"/>
    529                                                                                                                         </dbx:when>
    530                                                                                                                         <dbx:when test="$current/status='preferred name'">
    531                                                                                                                                 <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-14"/>
    532                                                                                                                         </dbx:when>
    533                                                                                                                         <dbx:when test="$current/status='admitted name'">
    534                                                                                                                                 <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-15"/>
    535                                                                                                                         </dbx:when>
    536                                                                                                                         <dbx:when test="$current/status='deprecated name'">
    537                                                                                                                                 <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-16"/>
    538                                                                                                                         </dbx:when>
    539                                                                                                                         <dbx:when test="$current/status='superseded name'">
    540                                                                                                                                 <dbx:attribute name="dcr:valueDatcat" value="http://www.isocat.org/datcat/DC-17"/>
    541                                                                                                                         </dbx:when>
    542                                                                                                                 </dbx:choose>
    543                                                                                                         </dcif:nameStatus>
    544                                                                                                 </dcif:nameSection>
    545                                                                                         </dbx:for-each>
    546                                                                                         <dbx:for-each table="generic_text" min="0" max="*">
    547                                                                                                 <dbx:where field="owner" select="$current/id" type="integer"/>
    548                                                                                                 <dbx:where field="owner_type" value="language section" type="string"/>
    549                                                                                                 <dbx:where field="text_type"  value="definition"       type="string"/>
    550                                                                                                 <dbx:sort field="id"/>
    551                                                                                                 <dcif:definitionSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2413">
    552                                                                                                         <dcif:definition dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-32">
     561                                                                                                        </dcif:definitionSection>
     562                                                                                                </dbx:for-each>
     563                                                                                                <dbx:for-each table="generic_text" min="0" max="*">
     564                                                                                                        <dbx:where field="owner" select="$current/id" type="integer"/>
     565                                                                                                        <dbx:where field="owner_type" value="language section" type="string"/>
     566                                                                                                        <dbx:where field="text_type"  value="example"          type="string"/>
     567                                                                                                        <dbx:sort field="id"/>
     568                                                                                                        <dcif:exampleSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2403">
     569                                                                                                                <dcif:example dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-33">
     570                                                                                                                        <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     571                                                                                                                        <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
     572                                                                                                                </dcif:example>
     573                                                                                                                <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27" dbx:when="normalize-space(.)!=''"/>
     574                                                                                                        </dcif:exampleSection>
     575                                                                                                </dbx:for-each>
     576                                                                                                <dbx:for-each table="generic_text" min="0" max="*">
     577                                                                                                        <dbx:where field="owner" select="$current/id" type="integer"/>
     578                                                                                                        <dbx:where field="owner_type" value="language section" type="string"/>
     579                                                                                                        <dbx:where field="text_type"  value="explanation"      type="string"/>
     580                                                                                                        <dbx:sort field="id"/>
     581                                                                                                        <dcif:explanationSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2404">
     582                                                                                                                <dcif:explanation dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-34">
     583                                                                                                                        <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
     584                                                                                                                        <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
     585                                                                                                                </dcif:explanation>
     586                                                                                                                <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27" dbx:when="normalize-space(.)!=''"/>
     587                                                                                                        </dcif:explanationSection>
     588                                                                                                </dbx:for-each>
     589                                                                                                <dbx:for-each table="generic_text" min="0" max="*">
     590                                                                                                        <dbx:where field="owner" select="$current/id" type="integer"/>
     591                                                                                                        <dbx:where field="owner_type" value="language section" type="string"/>
     592                                                                                                        <dbx:where field="text_type"  value="note"             type="string"/>
     593                                                                                                        <dbx:sort field="id"/>
     594                                                                                                        <dcif:note isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-36">
    553595                                                                                                                <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    554596                                                                                                                <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
    555                                                                                                         </dcif:definition>
    556                                                                                                         <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27"/>
    557                                                                                                         <dbx:for-each table="generic_text" min="0" max="1">
    558                                                                                                                 <dbx:where field="owner" select="$current/id" type="integer"/>
    559                                                                                                                 <dbx:where field="owner_type" value="text" type="string"/>
    560                                                                                                                 <dbx:where field="text_type"  value="note" type="string"/>
    561                                                                                                                 <dbx:sort field="id"/>
    562                                                                                                                 <dcif:note isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-36">
    563                                                                                                                         <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    564                                                                                                                         <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
    565                                                                                                                 </dcif:note>
    566                                                                                                         </dbx:for-each>
    567                                                                                                 </dcif:definitionSection>
    568                                                                                         </dbx:for-each>
    569                                                                                         <dbx:for-each table="generic_text" min="0" max="*">
    570                                                                                                 <dbx:where field="owner" select="$current/id" type="integer"/>
    571                                                                                                 <dbx:where field="owner_type" value="language section" type="string"/>
    572                                                                                                 <dbx:where field="text_type"  value="example"          type="string"/>
    573                                                                                                 <dbx:sort field="id"/>
    574                                                                                                 <dcif:exampleSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2403">
    575                                                                                                         <dcif:example dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-33">
    576                                                                                                                 <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    577                                                                                                                 <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
    578                                                                                                         </dcif:example>
    579                                                                                                         <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27" dbx:when="normalize-space(.)!=''"/>
    580                                                                                                 </dcif:exampleSection>
    581                                                                                         </dbx:for-each>
    582                                                                                         <dbx:for-each table="generic_text" min="0" max="*">
    583                                                                                                 <dbx:where field="owner" select="$current/id" type="integer"/>
    584                                                                                                 <dbx:where field="owner_type" value="language section" type="string"/>
    585                                                                                                 <dbx:where field="text_type"  value="explanation"      type="string"/>
    586                                                                                                 <dbx:sort field="id"/>
    587                                                                                                 <dcif:explanationSection isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-2404">
    588                                                                                                         <dcif:explanation dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-34">
    589                                                                                                                 <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    590                                                                                                                 <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
    591                                                                                                         </dcif:explanation>
    592                                                                                                         <dcif:source dbx:field="source" dcr:datcat="http://www.isocat.org/datcat/DC-27" dbx:when="normalize-space(.)!=''"/>
    593                                                                                                 </dcif:explanationSection>
    594                                                                                         </dbx:for-each>
    595                                                                                         <dbx:for-each table="generic_text" min="0" max="*">
    596                                                                                                 <dbx:where field="owner" select="$current/id" type="integer"/>
    597                                                                                                 <dbx:where field="owner_type" value="language section" type="string"/>
    598                                                                                                 <dbx:where field="text_type"  value="note"             type="string"/>
    599                                                                                                 <dbx:sort field="id"/>
    600                                                                                                 <dcif:note isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-36">
    601                                                                                                         <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/>
    602                                                                                                         <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/>
    603                                                                                                 </dcif:note>
    604                                                                                         </dbx:for-each>
    605                                                                                 </dcif:languageSection>
    606                                                                         </dbx:for-each>
    607                                                                 </dcif:descriptionSection>
    608                                                         </dbx:when>
    609                                                 </dbx:choose>
    610                                                 <dbx:choose>
    611                                                         <dbx:when test="$mode!='list'">
    612                                                                 <dbx:choose>
    613                                                                         <dbx:when test="$current/type='open'">
    614                                                                                 <dbx:for-each table="link_open_data_category_conceptual_domain" min="1" max="1">
    615                                                                                         <dbx:where field="dc" select="$current/id"/>
    616                                                                                         <dbx:for-each table="core_open_conceptual_domain" min="1" max="1">
    617                                                                                                 <dbx:where field="id" select="$current/cd"/>
    618                                                                                                 <dcif:conceptualDomain isocat:id="{$current/id}" type="open" dcr:datcat="http://www.isocat.org/datcat/DC-4">
    619                                                                                                         <dbx:for-each table="core_conceptual_domain" min="1" max="1">
    620                                                                                                                 <dbx:where field="id" select="$current/id"/>
    621                                                                                                                 <dbx:for-each table="core_data_type" min="1" max="1">
    622                                                                                                                         <dbx:where field="id" select="$current/data_type"/>
    623                                                                                                                         <dcif:dataType isocat:id="{$current/id}" dbx:field="data_type" dcr:datcat="http://www.isocat.org/datcat/DC-2397"/>
    624                                                                                                                 </dbx:for-each>
    625                                                                                                         </dbx:for-each>
    626                                                                                                 </dcif:conceptualDomain>
    627                                                                                         </dbx:for-each>
     597                                                                                                        </dcif:note>
     598                                                                                                </dbx:for-each>
     599                                                                                        </dcif:languageSection>
    628600                                                                                </dbx:for-each>
    629                                                                         </dbx:when>
    630                                                                         <dbx:when test="$current/type='constrained'">
    631                                                                                 <dbx:for-each table="link_constrained_data_category_conceptual_domains" min="1" max="*">
    632                                                                                         <dbx:where field="dc" select="$current/id"/>
    633                                                                                         <dbx:call-template name="constrained_conceptual_domain"/>
    634                                                                                 </dbx:for-each>
    635                                                                         </dbx:when>
    636                                                                         <dbx:when test="$current/type='closed'">
    637                                                                                 <dbx:for-each table="link_closed_data_category_conceptual_domains" min="1" max="*">
    638                                                                                         <dbx:where field="dc" select="$current/id"/>
    639                                                                                         <dbx:for-each table="core_profile_value_domain" min="1" max="1">
    640                                                                                                 <dbx:where field="id" select="$current/cd"/>
    641                                                                                                 <dbx:where field="profile" operator="in" select="$profiles//id" when="exists($profiles//id)"/>
    642                                                                                                 <dcif:conceptualDomain isocat:id="{$current/id}" type="closed" dcr:datcat="http://www.isocat.org/datcat/DC-4">
    643                                                                                                         <dbx:choose>
    644                                                                                                                 <dbx:when test="($suppress='true') and ($suppress-context-type='profile') and ($current/profile!=$suppress-context)">
    645                                                                                                                         <dbx:attribute name="isocat:suppress" value="true"/>
    646                                                                                                                 </dbx:when>
    647                                                                                                         </dbx:choose>
    648                                                                                                         <dbx:for-each table="core_conceptual_domain" min="1" max="1">
    649                                                                                                                 <dbx:where field="id" select="$current/id"/>
    650                                                                                                                 <dbx:for-each table="core_data_type" min="1" max="1">
    651                                                                                                                         <dbx:where field="id" select="$current/data_type"/>
    652                                                                                                                         <dcif:dataType isocat:id="{$current/id}" dbx:field="data_type" dcr:datcat="http://www.isocat.org/datcat/DC-2397"/>
    653                                                                                                                 </dbx:for-each>
    654                                                                                                         </dbx:for-each>
    655                                                                                                         <dbx:for-each table="core_profile" min="1" max="1">
    656                                                                                                                 <dbx:where field="id" select="$current/profile"/>
    657                                                                                                                 <dcif:profile isocat:id="{$current/id}" dbx:field="name" dcr:datcat="http://www.isocat.org/datcat/DC-37"/>
    658                                                                                                         </dbx:for-each>
    659                                                                                                         <dbx:for-each table="link_value_domain_values" min="1" max="*">
    660                                                                                                                 <dbx:where field="cd" select="$current/id"/>
    661                                                                                                                 <dbx:call-template name="value"/>
    662                                                                                                         </dbx:for-each>
    663                                                                                                 </dcif:conceptualDomain>
    664                                                                                         </dbx:for-each>
    665                                                                                 </dbx:for-each>
    666                                                                         </dbx:when>
    667                                                                 </dbx:choose>
    668                                                                 <dbx:choose>
    669                                                                         <dbx:when test="$current/type='open' or $current/type='constrained'">
    670                                                                                 <dbx:for-each table="core_constrained_linguistic_section" min="0" max="*">
    671                                                                                         <dbx:where field="dc" select="$current/id"/>
    672                                                                                         <dbx:for-each table="core_linguistic_section" min="1" max="1">
    673                                                                                                 <dbx:where field="id" select="$current/id"/>
    674                                                                                                 <dbx:where field="language" operator="in" select="$object-languages//id" type="integer" when="exists($object-languages//id)"/>
    675                                                                                                 <dcif:linguisticSection isocat:id="{$current/id}" type="constrained" dcr:datcat="http://www.isocat.org/datcat/DC-2408">
    676                                                                                                         <dbx:call-template name="linguistic_section-core"/>
    677                                                                                                         <dbx:for-each table="link_constrained_linguistic_section_conceptual_domains" min="0" max="*">
    678                                                                                                                 <dbx:where field="ls" select="$current/id"/>
    679                                                                                                                 <dbx:call-template name="constrained_conceptual_domain"/>
    680                                                                                                         </dbx:for-each>
    681                                                                                                 </dcif:linguisticSection>
    682                                                                                         </dbx:for-each>
    683                                                                                 </dbx:for-each>
    684                                                                         </dbx:when>
    685                                                                         <dbx:when test="$current/type='closed'">
    686                                                                                 <dbx:for-each table="core_closed_linguistic_section" min="0" max="*">
    687                                                                                         <dbx:where field="dc" select="$current/id"/>
    688                                                                                         <dbx:variable name="ol" when="exists($object-languages//id)" query="
    689                                                                                                 SELECT
    690                                                                                                         language
    691                                                                                                 FROM
    692                                                                                                         core_linguistic_section
    693                                                                                                 WHERE
    694                                                                                                         id = {$current/id}
    695                                                                                                 ;
    696                                                                                         "/>
    697                                                                                         <dbx:variable name="ol" when="empty($object-languages//id)" select="()"/>
    698                                                                                         <dcif:linguisticSection isocat:id="{$current/id}" type="closed" dcr:datcat="http://www.isocat.org/datcat/DC-2408" dbx:when="(empty($object-languages//id)) or (exists($object-languages//id[.=$ol//language]))">
    699                                                                                                 <dbx:call-template name="linguistic_section-core"/>
    700                                                                                                 <dbx:for-each table="core_value_domain" min="0" max="1">
    701                                                                                                         <dbx:where field="id" select="$current/cd" fallback="0"/>
    702                                                                                                         <dcif:conceptualDomain type="closed" isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-4">
     601                                                                        </dcif:descriptionSection>
     602                                                                </dbx:when>
     603                                                        </dbx:choose>
     604                                                        <dbx:choose>
     605                                                                <dbx:when test="$mode!='list'">
     606                                                                        <dbx:choose>
     607                                                                                <dbx:when test="$current/type='open'">
     608                                                                                        <dbx:for-each table="link_open_data_category_conceptual_domain" min="1" max="1">
     609                                                                                                <dbx:where field="dc" select="$current/id"/>
     610                                                                                                <dbx:for-each table="core_open_conceptual_domain" min="1" max="1">
     611                                                                                                        <dbx:where field="id" select="$current/cd"/>
     612                                                                                                        <dcif:conceptualDomain isocat:id="{$current/id}" type="open" dcr:datcat="http://www.isocat.org/datcat/DC-4">
    703613                                                                                                                <dbx:for-each table="core_conceptual_domain" min="1" max="1">
    704614                                                                                                                        <dbx:where field="id" select="$current/id"/>
     
    708618                                                                                                                        </dbx:for-each>
    709619                                                                                                                </dbx:for-each>
     620                                                                                                        </dcif:conceptualDomain>
     621                                                                                                </dbx:for-each>
     622                                                                                        </dbx:for-each>
     623                                                                                </dbx:when>
     624                                                                                <dbx:when test="$current/type='constrained'">
     625                                                                                        <dbx:for-each table="link_constrained_data_category_conceptual_domains" min="1" max="*">
     626                                                                                                <dbx:where field="dc" select="$current/id"/>
     627                                                                                                <dbx:call-template name="constrained_conceptual_domain"/>
     628                                                                                        </dbx:for-each>
     629                                                                                </dbx:when>
     630                                                                                <dbx:when test="$current/type='closed'">
     631                                                                                        <dbx:for-each table="link_closed_data_category_conceptual_domains" min="1" max="*">
     632                                                                                                <dbx:where field="dc" select="$current/id"/>
     633                                                                                                <dbx:for-each table="core_profile_value_domain" min="1" max="1">
     634                                                                                                        <dbx:where field="id" select="$current/cd"/>
     635                                                                                                        <dbx:where field="profile" operator="in" select="$profiles//id" when="exists($profiles//id)"/>
     636                                                                                                        <dcif:conceptualDomain isocat:id="{$current/id}" type="closed" dcr:datcat="http://www.isocat.org/datcat/DC-4">
     637                                                                                                                <dbx:choose>
     638                                                                                                                        <dbx:when test="($suppress='true') and ($suppress-context-type='profile') and ($current/profile!=$suppress-context)">
     639                                                                                                                                <dbx:attribute name="isocat:suppress" value="true"/>
     640                                                                                                                        </dbx:when>
     641                                                                                                                </dbx:choose>
     642                                                                                                                <dbx:for-each table="core_conceptual_domain" min="1" max="1">
     643                                                                                                                        <dbx:where field="id" select="$current/id"/>
     644                                                                                                                        <dbx:for-each table="core_data_type" min="1" max="1">
     645                                                                                                                                <dbx:where field="id" select="$current/data_type"/>
     646                                                                                                                                <dcif:dataType isocat:id="{$current/id}" dbx:field="data_type" dcr:datcat="http://www.isocat.org/datcat/DC-2397"/>
     647                                                                                                                        </dbx:for-each>
     648                                                                                                                </dbx:for-each>
     649                                                                                                                <dbx:for-each table="core_profile" min="1" max="1">
     650                                                                                                                        <dbx:where field="id" select="$current/profile"/>
     651                                                                                                                        <dcif:profile isocat:id="{$current/id}" dbx:field="name" dcr:datcat="http://www.isocat.org/datcat/DC-37"/>
     652                                                                                                                </dbx:for-each>
    710653                                                                                                                <dbx:for-each table="link_value_domain_values" min="1" max="*">
    711654                                                                                                                        <dbx:where field="cd" select="$current/id"/>
     
    714657                                                                                                        </dcif:conceptualDomain>
    715658                                                                                                </dbx:for-each>
    716                                                                                         </dcif:linguisticSection>
    717                                                                                 </dbx:for-each>
    718                                                                         </dbx:when>
    719                                                                 </dbx:choose>
    720                                                                 <dbx:choose>
    721                                                                         <dbx:when test="$current/type='simple'">
    722                                                                                 <dbx:for-each table="link_simple_data_category_super" min="0" max="1">
    723                                                                                         <!-- for now there can only be one super for a simple DC -->
    724                                                                                         <dbx:where field="dc" select="$current/id"/>
    725                                                                                         <dbx:for-each table="core_data_category" min="1" max="1">
    726                                                                                                 <dbx:where field="id" select="$current/super"/>
    727                                                                                                 <dcif:isA dcr:datcat="http://www.isocat.org/datcat/DC-2409">
    728                                                                                                         <dbx:call-template name="data_category-reference"/>
    729                                                                                                 </dcif:isA>
    730                                                                                         </dbx:for-each>
    731                                                                                 </dbx:for-each>
    732                                                                         </dbx:when>
    733                                                                 </dbx:choose>
    734                                                         </dbx:when>
    735                                                 </dbx:choose>
    736                                         </dcif:dataCategory>
     659                                                                                        </dbx:for-each>
     660                                                                                </dbx:when>
     661                                                                        </dbx:choose>
     662                                                                        <dbx:choose>
     663                                                                                <dbx:when test="$current/type='open' or $current/type='constrained'">
     664                                                                                        <dbx:for-each table="core_constrained_linguistic_section" min="0" max="*">
     665                                                                                                <dbx:where field="dc" select="$current/id"/>
     666                                                                                                <dbx:for-each table="core_linguistic_section" min="1" max="1">
     667                                                                                                        <dbx:where field="id" select="$current/id"/>
     668                                                                                                        <dbx:where field="language" operator="in" select="$object-languages//id" type="integer" when="exists($object-languages//id)"/>
     669                                                                                                        <dcif:linguisticSection isocat:id="{$current/id}" type="constrained" dcr:datcat="http://www.isocat.org/datcat/DC-2408">
     670                                                                                                                <dbx:call-template name="linguistic_section-core"/>
     671                                                                                                                <dbx:for-each table="link_constrained_linguistic_section_conceptual_domains" min="0" max="*">
     672                                                                                                                        <dbx:where field="ls" select="$current/id"/>
     673                                                                                                                        <dbx:call-template name="constrained_conceptual_domain"/>
     674                                                                                                                </dbx:for-each>
     675                                                                                                        </dcif:linguisticSection>
     676                                                                                                </dbx:for-each>
     677                                                                                        </dbx:for-each>
     678                                                                                </dbx:when>
     679                                                                                <dbx:when test="$current/type='closed'">
     680                                                                                        <dbx:for-each table="core_closed_linguistic_section" min="0" max="*">
     681                                                                                                <dbx:where field="dc" select="$current/id"/>
     682                                                                                                <dbx:variable name="ol" when="exists($object-languages//id)" query="
     683                                                                                                        SELECT
     684                                                                                                                language
     685                                                                                                        FROM
     686                                                                                                                core_linguistic_section
     687                                                                                                        WHERE
     688                                                                                                                id = {$current/id}
     689                                                                                                        ;
     690                                                                                                "/>
     691                                                                                                <dbx:variable name="ol" when="empty($object-languages//id)" select="()"/>
     692                                                                                                <dcif:linguisticSection isocat:id="{$current/id}" type="closed" dcr:datcat="http://www.isocat.org/datcat/DC-2408" dbx:when="(empty($object-languages//id)) or (exists($object-languages//id[.=$ol//language]))">
     693                                                                                                        <dbx:call-template name="linguistic_section-core"/>
     694                                                                                                        <dbx:for-each table="core_value_domain" min="0" max="1">
     695                                                                                                                <dbx:where field="id" select="$current/cd" fallback="0"/>
     696                                                                                                                <dcif:conceptualDomain type="closed" isocat:id="{$current/id}" dcr:datcat="http://www.isocat.org/datcat/DC-4">
     697                                                                                                                        <dbx:for-each table="core_conceptual_domain" min="1" max="1">
     698                                                                                                                                <dbx:where field="id" select="$current/id"/>
     699                                                                                                                                <dbx:for-each table="core_data_type" min="1" max="1">
     700                                                                                                                                        <dbx:where field="id" select="$current/data_type"/>
     701                                                                                                                                        <dcif:dataType isocat:id="{$current/id}" dbx:field="data_type" dcr:datcat="http://www.isocat.org/datcat/DC-2397"/>
     702                                                                                                                                </dbx:for-each>
     703                                                                                                                        </dbx:for-each>
     704                                                                                                                        <dbx:for-each table="link_value_domain_values" min="1" max="*">
     705                                                                                                                                <dbx:where field="cd" select="$current/id"/>
     706                                                                                                                                <dbx:call-template name="value"/>
     707                                                                                                                        </dbx:for-each>
     708                                                                                                                </dcif:conceptualDomain>
     709                                                                                                        </dbx:for-each>
     710                                                                                                </dcif:linguisticSection>
     711                                                                                        </dbx:for-each>
     712                                                                                </dbx:when>
     713                                                                        </dbx:choose>
     714                                                                        <dbx:choose>
     715                                                                                <dbx:when test="$current/type='simple'">
     716                                                                                        <dbx:for-each table="link_simple_data_category_super" min="0" max="1">
     717                                                                                                <!-- for now there can only be one super for a simple DC -->
     718                                                                                                <dbx:where field="dc" select="$current/id"/>
     719                                                                                                <dbx:for-each table="core_data_category" min="1" max="1">
     720                                                                                                        <dbx:where field="id" select="$current/super"/>
     721                                                                                                        <dcif:isA dcr:datcat="http://www.isocat.org/datcat/DC-2409">
     722                                                                                                                <dbx:call-template name="data_category-reference"/>
     723                                                                                                        </dcif:isA>
     724                                                                                                </dbx:for-each>
     725                                                                                        </dbx:for-each>
     726                                                                                </dbx:when>
     727                                                                        </dbx:choose>
     728                                                                </dbx:when>
     729                                                        </dbx:choose>
     730                                                </dcif:dataCategory>
     731                                        </dbx:cache>
    737732                                </dbx:for-each>
    738733                        </dbx:for-each>
Note: See TracChangeset for help on using the changeset viewer.