Changeset 2846


Ignore:
Timestamp:
04/29/13 07:43:37 (11 years ago)
Author:
teckart
Message:

Updated cmdi2xhtml stylesheet (#303, more efficient use of screen space)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlo/trunk/vlo_importer/src/main/resources/cmdi2xhtml.xsl

    r2768 r2846  
    77    version="2.0"
    88    xpath-default-namespace="http://www.clarin.eu/cmd/">
     9    <!--   
     10    <!DOCTYPE html>
     11    -->
    912
    1013    <xsl:output
    1114        method="html"
    1215        encoding="UTF-8"
     16        doctype-system="about:legacy-compat"
    1317        indent="yes"
    1418        cdata-section-elements="td"/>
    1519   
    1620    <xsl:param name="prune_Components_branches_without_text_values" as="xs:boolean" select='false()'/>
    17     <xsl:param name="termValue"/>
    1821   
    1922
     
    2326        <ul>
    2427            <xsl:for-each select="$nodeset/element()">
    25                 <!--fn:normalize-space(-->
    2628                <xsl:variable name="subnodes_text" select="fn:normalize-space(fn:string-join(descendant-or-self::element()/text(), ''))" as="xs:string+"/>
    2729                <xsl:if test="not($subnodes_text = '' and $prune_Components_branches_without_text_values)">
    2830                    <xsl:variable name="nchildren" select="fn:count(child::element())"/>
    29                      <li>                   
    30                      <code>
     31                     <li>
     32                     
     33                     <code class="node">
    3134                         <xsl:value-of select="fn:concat(local-name(), ' ')"/>
    3235                         <xsl:if test="count(@*) > 0">
     
    4144                     <xsl:choose>
    4245                         <xsl:when test="$nchildren = 0">
    43                              <br /><br />
     46                             <!--<br /><br />-->
    4447                             <div class="Component_tree_node_content">
    45                                   <sample><xsl:value-of select="self::element()"/></sample>
     48                                 <xsl:variable name="leaf_value" select="self::element()"                       as="xs:string"/>
     49                                 <xsl:variable name="HTTP_URL"   select="starts-with($leaf_value, 'http://')"   as="xs:boolean"/>
     50                                 <code class="leaf">
     51                                 <xsl:choose>
     52                                     <xsl:when test="$HTTP_URL">
     53                                         <a href="{$leaf_value}"><xsl:value-of select="$leaf_value"/></a>
     54                                     </xsl:when>
     55                                     <xsl:otherwise>                                   
     56                                             <xsl:value-of select="$leaf_value"/>                                         
     57                                     </xsl:otherwise>                                 
     58                                 </xsl:choose>
     59                                 </code>
    4660                             </div>
    4761                         </xsl:when>
     
    5468                         </xsl:otherwise>
    5569                     </xsl:choose>
    56                     </li>
     70                                     
     71                    </li>                               
    5772                </xsl:if>
    5873            </xsl:for-each>
    5974        </ul>
    6075    </xsl:template>
    61    
     76
     77
    6278    <xsl:template match="CMD">
    63        <!-- TODO <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    64             <meta charset="utf-8"/>
    65             <head>
    66                 <title>CMDI collection "<xsl:value-of select="./Header/MdCollectionDisplayName" xmlns="cmd"/>"
    67                 </title>
    68                     <link rel="stylesheet" type="text/css" href="http://catalog.clarin.eu/ds/vlo/css/main.css"/>
    69              -->
    70            
    7179                <style media="screen" type="text/css">
    7280                    <![CDATA[
     
    7785                    }
    7886                   
    79                     code
     87                    .node
    8088                    {
    8189                        background-color: rgba(188, 205, 232, 0.8);
     
    8391                        font-weight: bold;
    8492                        padding: 5px;
    85                     }
     93                        /*float: left;*/
     94                    }                   
     95                   
     96                    .leaf
     97                    {
     98                    }                   
    8699                   
    87100                    .Component_tree_node_content
     
    90103                        border: 1px dotted red;                       
    91104                        margin-top: 10px;
     105                        margin-left: 10px;
    92106                        padding: 5px;
    93                         float: none;               
    94                         display:table-cell;
     107                        display: inline-block;
     108                        /*float: left;*/       
     109                        /*display: table-cell;*/
    95110                    }                   
    96111                   
    97112                    .attributes
    98                     {
     113                    {                       
    99114                        display: inline-block;
    100115                        font-style: italic;
    101116                        font-weight: normal;
    102                         /* background-color: rgba(100, 201, 234, 0.4); */
     117                        /*background-color: rgba(100, 201, 234, 0.4);*/
    103118                    }
     119                   
     120                    footer
     121                    {
     122                        border: 1px dotted;
     123                    }                   
    104124                   
    105125                    address
     
    111131                    ]]>
    112132                </style>
    113          <!--   </head>
    114             <body> -->
    115133                <article style="background-color:#EEEEEE">
    116134                    <div class="endgame">
     
    160178                        </p>
    161179                    </div>
    162 
    163                     <!--                   
    164                     <p>
    165                         <h1>Journal file proxy list</h1>
    166                         <xsl:for-each select="JournalFileProxyList"> </xsl:for-each>
    167                     </p>
    168                    
    169                     <p>
    170                         <h1>Resource relations</h1>
    171                         <xsl:for-each select="Resources/ResourceRelationList/ResourceRelation"> </xsl:for-each>
    172                     </p>
    173                     -->
    174180                   
    175181                    <p>
     
    177183                        <xsl:call-template name="Component_tree"/>
    178184                    </p>
    179                    
    180                     <!-- TODO<footer>
    181                         <p>Created by <address class="author"> <xsl:value-of select="Header/MdCreator"/>
    182                         </address> on <time datetime="{Header/MdCreationDate}">
    183                                 <xsl:value-of select="Header/MdCreationDate"
    184                                 /></time>
    185                             <br />
    186                             <small>Located at <a href="{Header/MdSelfLink}">
    187                                     <xsl:value-of select="Header/MdSelfLink"/></a>
    188                             </small>
    189                             <br />
    190                             <small>Belongs to <xsl:value-of select="Header/MdCollectionDisplayName"
    191                                 />
    192                             </small>
    193                             <br />
    194                             <xsl:variable name="resource_URL"
    195                                 select="fn:concat('http://catalog.clarin.eu/ds/ComponentRegistry?item=',Header/MdProfile)"/>
    196                             <small>Based on <a href="{$resource_URL}"><xsl:value-of select="$resource_URL"/></a>
    197                             </small>
    198                         </p>
    199                     </footer>-->
    200185                </article>
    201            <!--TODO </body>
    202         </html> -->
    203 
    204186    </xsl:template>
    205187</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.