|
66 | 66 | ]
|
67 | 67 | )">
|
68 | 68 | <fr:date>
|
69 |
| - <xsl:if test="$is-static-readonly and ($is-pdf-mode or not($date-native-picker = 'always'))"> |
70 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
71 |
| - </xsl:if> |
| 69 | + <xsl:choose> |
| 70 | + <xsl:when test="$is-static-readonly and ($is-pdf-mode or not($date-native-picker = 'always'))"> |
| 71 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 72 | + </xsl:when> |
| 73 | + <xsl:when test="$use-pdf-template"> |
| 74 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 75 | + </xsl:when> |
| 76 | + </xsl:choose> |
72 | 77 | <xsl:apply-templates select="@* | node()" mode="#current"/>
|
73 | 78 | <!-- See other comment further "Q: Do we really need this?" -->
|
74 | 79 | <xsl:if test="empty(xf:alert)">
|
|
84 | 89 | ]
|
85 | 90 | )">
|
86 | 91 | <fr:time>
|
87 |
| - <xsl:if test="$is-static-readonly and ($is-pdf-mode or not($time-native-picker = 'always'))"> |
88 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
89 |
| - </xsl:if> |
| 92 | + <xsl:choose> |
| 93 | + <xsl:when test="$is-static-readonly and ($is-pdf-mode or not($time-native-picker = 'always'))"> |
| 94 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 95 | + </xsl:when> |
| 96 | + <xsl:when test="$use-pdf-template"> |
| 97 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 98 | + </xsl:when> |
| 99 | + </xsl:choose> |
90 | 100 | <xsl:apply-templates select="@* | node()" mode="#current"/>
|
91 | 101 | <!-- See other comment further "Q: Do we really need this?" -->
|
92 | 102 | <xsl:if test="empty(xf:alert)">
|
|
109 | 119 | mode="within-grid">
|
110 | 120 | <!-- For now this only applies to controls that have an `xf:select1` binding -->
|
111 | 121 | <xsl:element name="xf:select1">
|
112 |
| - <xsl:if test="$is-static-readonly"> |
113 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
114 |
| - </xsl:if> |
| 122 | + <xsl:choose> |
| 123 | + <xsl:when test="$is-static-readonly"> |
| 124 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 125 | + </xsl:when> |
| 126 | + <xsl:when test="$use-pdf-template"> |
| 127 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 128 | + </xsl:when> |
| 129 | + </xsl:choose> |
115 | 130 | <xsl:apply-templates select="@* except (@appearance, @fr:pdf-appearance)" mode="#current"/>
|
116 | 131 | <xsl:attribute name="appearance" select="(@fr:pdf-appearance, map:get($select1-pdf-appearances, fr:direct-name-for-select1-element(.)))[1]"/>
|
117 | 132 | <xsl:apply-templates select="node()" mode="#current"/>
|
|
146 | 161 | <xsl:choose>
|
147 | 162 | <xsl:when test="frf:controlNameFromId(@id) = $choice-validation-selection-control-names">
|
148 | 163 | <xsl:copy>
|
149 |
| - <xsl:if test="$is-static-readonly"> |
150 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
151 |
| - </xsl:if> |
| 164 | + <xsl:choose> |
| 165 | + <xsl:when test="$is-static-readonly"> |
| 166 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 167 | + </xsl:when> |
| 168 | + <xsl:when test="$use-pdf-template"> |
| 169 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 170 | + </xsl:when> |
| 171 | + </xsl:choose> |
152 | 172 | <xsl:apply-templates select="@* | node()" mode="#current"/>
|
153 | 173 | <xf:alert
|
154 | 174 | ref="
|
|
201 | 221 | match="xf:output[exists(xf:label) and empty(@appearance)]"
|
202 | 222 | mode="within-grid">
|
203 | 223 | <xsl:copy>
|
204 |
| - <xsl:if test="$is-static-readonly"> |
205 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
206 |
| - </xsl:if> |
| 224 | + <xsl:choose> |
| 225 | + <xsl:when test="$is-static-readonly"> |
| 226 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 227 | + </xsl:when> |
| 228 | + <xsl:when test="$use-pdf-template"> |
| 229 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 230 | + </xsl:when> |
| 231 | + </xsl:choose> |
207 | 232 | <xsl:for-each select="$calculated-value-appearance[. != 'full']"><!-- `full` is the default so don't bother adding the attribute in this case -->
|
208 | 233 | <xsl:attribute name="appearance" select="."/>
|
209 | 234 | </xsl:for-each>
|
|
217 | 242 | mode="within-grid">
|
218 | 243 | <xsl:param name="library-name" as="xs:string?" tunnel="yes"/>
|
219 | 244 | <xsl:copy>
|
220 |
| - <xsl:if test="$is-static-readonly"> |
221 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
222 |
| - </xsl:if> |
| 245 | + <xsl:choose> |
| 246 | + <xsl:when test="$is-static-readonly"> |
| 247 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 248 | + </xsl:when> |
| 249 | + <xsl:when test="$use-pdf-template"> |
| 250 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 251 | + </xsl:when> |
| 252 | + </xsl:choose> |
223 | 253 | <xsl:for-each select="@prefix | @suffix">
|
224 | 254 | <xsl:attribute name="{name(.)}" select="frf:replaceVarReferencesWithFunctionCallsFromString(., ., true(), $library-name, ())"/>
|
225 | 255 | </xsl:for-each>
|
|
233 | 263 | mode="within-grid">
|
234 | 264 | <xsl:param name="library-name" as="xs:string?" tunnel="yes"/>
|
235 | 265 | <xsl:copy>
|
236 |
| - <xsl:if test="$is-static-readonly"> |
237 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
238 |
| - </xsl:if> |
| 266 | + <xsl:choose> |
| 267 | + <xsl:when test="$is-static-readonly"> |
| 268 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 269 | + </xsl:when> |
| 270 | + <xsl:when test="$use-pdf-template"> |
| 271 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 272 | + </xsl:when> |
| 273 | + </xsl:choose> |
239 | 274 | <xsl:if test="exists(@resource | @selection)">
|
240 | 275 | <!-- As calls below can generate `frf:controlVariableValue()` -->
|
241 | 276 | <xsl:namespace name="frf" select="'java:org.orbeon.oxf.fr.FormRunner'"/>
|
|
357 | 392 | match="*[parent::fr:c or parent::xh:td]"
|
358 | 393 | priority="-10">
|
359 | 394 | <xsl:copy>
|
360 |
| - <xsl:if test=" |
361 |
| - $is-static-readonly and ( |
362 |
| - $is-pdf-mode or ( |
363 |
| - (: `view` mode :) |
364 |
| - not( |
365 |
| - (exists(self::fr:date) and (@native-picker/string(), $date-native-picker)[1] = 'always') or |
366 |
| - (exists(self::fr:time) and (@native-picker/string(), $time-native-picker)[1] = 'always') |
| 395 | + <xsl:choose> |
| 396 | + <xsl:when test=" |
| 397 | + $is-static-readonly and ( |
| 398 | + $is-pdf-mode or ( |
| 399 | + (: `view` mode :) |
| 400 | + not( |
| 401 | + (exists(self::fr:date) and (@native-picker/string(), $date-native-picker)[1] = 'always') or |
| 402 | + (exists(self::fr:time) and (@native-picker/string(), $time-native-picker)[1] = 'always') |
| 403 | + ) |
367 | 404 | )
|
368 | 405 | )
|
369 |
| - ) |
370 |
| - "> |
371 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
372 |
| - </xsl:if> |
| 406 | + "> |
| 407 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 408 | + </xsl:when> |
| 409 | + <xsl:when test="$use-pdf-template"> |
| 410 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 411 | + </xsl:when> |
| 412 | + </xsl:choose> |
373 | 413 | <xsl:apply-templates select="@* | node()" mode="#current"/>
|
374 | 414 | </xsl:copy>
|
375 | 415 | </xsl:template>
|
|
382 | 422 | match="xf:*[local-name() = ('input', 'textarea', 'select', 'select1', 'upload', 'secret') and not(xf:alert)]"
|
383 | 423 | priority="-20">
|
384 | 424 | <xsl:copy>
|
385 |
| - <xsl:if test="$is-static-readonly"> |
386 |
| - <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
387 |
| - </xsl:if> |
| 425 | + <xsl:choose> |
| 426 | + <xsl:when test="$is-static-readonly"> |
| 427 | + <xsl:attribute name="fr:static-readonly">true</xsl:attribute> |
| 428 | + </xsl:when> |
| 429 | + <xsl:when test="$use-pdf-template"> |
| 430 | + <xsl:attribute name="fr:pdf-template">true</xsl:attribute> |
| 431 | + </xsl:when> |
| 432 | + </xsl:choose> |
388 | 433 | <xsl:apply-templates select="@* | node()" mode="#current"/>
|
389 | 434 | <xf:alert ref="xxf:r('detail.labels.alert', '|fr-fr-resources|')"/>
|
390 | 435 | </xsl:copy>
|
|
0 commit comments