Project

General

Profile

« Previous | Next » 

Revision 51542

#3560 - model parameter does not affect csv,tsv,html formatted results Json format changes: #3472 - better management in error format response #2762 - added check if element is result_subject to always be string #2545 - result is always an array, even if only one result is returned

View differences:

json.xsl
106 106
                    <xsl:value-of select="name()"/>
107 107
                    <xsl:text>" : [ </xsl:text>
108 108
                </xsl:when>
109
                <xsl:when test="$kctr = 1">
109
                <xsl:when test="$kctr = 1 and name()!='result'">
110 110
                    <xsl:text>"</xsl:text>
111 111
                    <xsl:value-of select="name()"/>
112 112
                    <xsl:text>" : </xsl:text>
113 113
                </xsl:when>
114
                <xsl:when test="$kctr = 1 and name()='result'">
115
                    <xsl:text>"</xsl:text>
116
                    <xsl:value-of select="name()"/>
117
                    <xsl:text>" : [</xsl:text>
118
                </xsl:when>
114 119
            </xsl:choose>
115 120
            <!-- count number of elements, text nodes and attribute nodes -->
116 121
            <xsl:variable name="nctr" select="count(*|text()|@*)"/>
......
167 172
                    </xsl:otherwise>
168 173
                </xsl:choose>
169 174
            </xsl:if>
175
            <xsl:if test="$kctr = 1 and name()='result'">
176
                <xsl:text> ]</xsl:text>
177
            </xsl:if>
170 178
        </xsl:for-each>
171 179
        <xsl:if test="position() != last()">
172 180
            <xsl:text>, </xsl:text>
......
178 186
        <xsl:variable name="t" select="." />
179 187
        <xsl:choose>
180 188
            <!-- test to see if it is a number -->
181
            <xsl:when test="string(number($t)) != 'NaN' and not(starts-with($t,'+')) and not(local-name(..)='code') ">
189
            <xsl:when test="string(number($t)) != 'NaN' and not(starts-with($t,'+')) and (not(local-name(..)='code') and not(local-name(..)='subject'))">
182 190
                <xsl:value-of select="$t"/>
183 191
            </xsl:when>
184 192
            <!-- deal with any case booleans -->

Also available in: Unified diff