source: MDService2/trunk/MDService2/src/xsl/test2view.xsl @ 1423

Last change on this file since 1423 was 1423, checked in by vronk, 13 years ago
File size: 2.1 KB
Line 
1<?xml version="1.0"?>
2<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:diag="http://www.loc.gov/zing/srw/diagnostic">
4
5<!--
6<purpose>special stylesheet for running test-queries defined as links in the input file</purpose>
7<params>
8<param name=""></param>
9</params>
10<history>
11        <change on="2010-11-12" type="created" by="vr">based on xml2htmltable</change> 
12       
13</history>
14-->
15
16<xsl:include href="cmd_commons.xsl"/> 
17
18<xsl:param name="title" select="if (//div[1][@class='title']) then concat('CMDRSB: ', //div[1][@class='title']) else 'CMDRSB docs'" />
19
20       
21<!--<xsl:output method="html" encoding="UTF-8"/>-->
22
23<xsl:template name="continue-root">
24                <xsl:apply-templates  />
25</xsl:template>
26
27<xsl:template match="a">
28
29 <div class="cmds-ui-block" >
30         <div class="ui-widget-header">
31                <xsl:value-of select="@class" />: <xsl:copy-of select="." /> [<xsl:value-of select="@href" />]
32        </div> 
33        <div class="ui-widget-content">
34                <xsl:choose>
35                        <xsl:when test="@class='count'">
36                                        <xsl:variable name="data" select="document(concat($base_url,@href))" />
37                                        <xsl:value-of select="count($data//*)" />
38                        </xsl:when>
39                        <xsl:when test="@class='queryxml'">
40                                        <xsl:variable name="data" select="document(concat($base_url,@href))" />
41                                        <xsl:value-of select="$data//numberOfRecords" />
42                        </xsl:when>
43                        <xsl:otherwise>
44                                        <xsl:apply-templates select="document(concat($base_url,@href))" mode="process-query"/>
45                        </xsl:otherwise>
46                </xsl:choose>           
47        </div>
48 </div>
49</xsl:template>
50
51<xsl:template match="*|@*">
52        <xsl:copy>
53                <xsl:apply-templates select="node()|@*" />
54        </xsl:copy>     
55</xsl:template>
56
57<xsl:template match="*|@*" mode="process-query" >
58        <xsl:copy>
59                <xsl:apply-templates select="node()|@*" mode="process-query" />
60        </xsl:copy>     
61</xsl:template>
62
63<!--
64 <diagnostics>
65        <diagnostic xmlns="http://www.loc.gov/zing/srw/diagnostic">
66    <uri>info:srw/diagnostic/1/1</uri>   
67    <message>Exception occurred: Connection refused: connect</message>
68-->
69<xsl:template match="diagnostics" mode="process-query" >
70        <div class="error" >
71                 <xsl:value-of select="diag:diagnostic/diag:message" />
72        </div> 
73</xsl:template>
74
75
76</xsl:stylesheet>
77 
Note: See TracBrowser for help on using the repository browser.