1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | <xsl:stylesheet version="3.0" |
---|
3 | xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" |
---|
4 | xmlns:ibis="http://www.ibisph.org" |
---|
5 | xmlns:xs ="http://www.w3.org/2001/XMLSchema" |
---|
6 | |
---|
7 | exclude-result-prefixes="ibis xs" |
---|
8 | > |
---|
9 | |
---|
10 | <ibis:doc> |
---|
11 | <name>html/ContentContainer</name> |
---|
12 | <summary>Templates for normal content, expandable, drop down, popup type content blocks.</summary> |
---|
13 | <description> |
---|
14 | Main template block code used throughout the app. |
---|
15 | |
---|
16 | The params defined below are defaults used by the templates so that |
---|
17 | ss.xslt (at any level) can set these to control default behavior. Example |
---|
18 | if an adopter wants to have all content blocks default to single select |
---|
19 | radio type expandable they'd set the main ss.xslt to override: |
---|
20 | ContentContainer.expandableControlType = 'radio' |
---|
21 | ContentContainer.defaultContentBlockType = 'expandable' |
---|
22 | Adopters can control with lower level ss.xslt code to change as needed. |
---|
23 | |
---|
24 | Another example is if wanting to have fluid, responsive pages. This is |
---|
25 | done with setting the container class with the appropriate css size related |
---|
26 | definitions. |
---|
27 | </description> |
---|
28 | </ibis:doc> |
---|
29 | |
---|
30 | |
---|
31 | <!-- ================================= M A I N C O N T R O L P A R A M S --> |
---|
32 | <xsl:param name="ContentContainer.defaultContentBlockType" select="'fixed'" |
---|
33 | ibis:doc="Used for the default contentBlock call. This allows for SS.xslt |
---|
34 | to override and control page behavior. Valid values are |
---|
35 | 'fixed' = standard always showing titled text block. |
---|
36 | 'expandable' = expandable content. |
---|
37 | 'inline' = no container. |
---|
38 | " |
---|
39 | /> |
---|
40 | <xsl:param name="ContentContainer.expandableControlType" select="'checkbox'" |
---|
41 | ibis:doc="Default expandable content control type. Valid values are 'radio' and 'checkbox'." |
---|
42 | /> |
---|
43 | <xsl:param name="ContentContainer.expandableControlName" select="'defaultPageExpandableContentGroup'" |
---|
44 | ibis:doc="Default expandable content control name that is used for 'radio' |
---|
45 | type expandable content controls. |
---|
46 | " |
---|
47 | /> |
---|
48 | |
---|
49 | <xsl:param name="ContentContainer.defaultContentContainerClass" select="'Container'" |
---|
50 | ibis:doc="Used as a default for fixed and expandabale block containers. |
---|
51 | This allows for SS.xslt to override and add more content container |
---|
52 | classes as needed. |
---|
53 | " |
---|
54 | /> |
---|
55 | <xsl:param name="ContentContainer.defaultFixedContentContainerClass" select="$ContentContainer.defaultContentContainerClass" |
---|
56 | ibis:doc="Fixed block container css - defaults to ContentContainer.defaultContentContainerClass." |
---|
57 | /> |
---|
58 | <xsl:param name="ContentContainer.expandableContentContainerClass" select="$ContentContainer.defaultContentContainerClass" |
---|
59 | ibis:doc="Expandable block content container css - defaults to ContentContainer.defaultContentContainerClass." |
---|
60 | /> |
---|
61 | |
---|
62 | <xsl:param name="ContentContainer.addWikiAttributeToContentContainer" select="false()" |
---|
63 | ibis:doc="Used for the default contentBlock addWikiControl. Value values are true(), false() - default = false." |
---|
64 | /> |
---|
65 | |
---|
66 | <xsl:param name="ContentContainer.titleLevel" select="3" as="xs:integer" |
---|
67 | ibis:doc="Used to control the default Hx title element creation for all |
---|
68 | block containers. This allows for SS.xslt to override the default. |
---|
69 | Default = 3. Value of 0 turns off. |
---|
70 | " |
---|
71 | /> |
---|
72 | |
---|
73 | |
---|
74 | |
---|
75 | <!-- =================================================== T E M P L A T E S --> |
---|
76 | <xsl:template name="ContentContainer.contentBlock" |
---|
77 | ibis:doc="Returns a titled block based on the contentBlockType parameter. |
---|
78 | This template is heavily used for all general content blocks so that |
---|
79 | and adopter can easily control their sites block behavior via ss.xslt |
---|
80 | parameter overrides. |
---|
81 | |
---|
82 | Used in HL index ul/li block, HL page Highlight.contentBlock HTML and |
---|
83 | fields, CP snapshot ul/li and buttons - HTML, QM result data sources |
---|
84 | ul/li map chart table, user selections HTML table, ip avail serv, |
---|
85 | indicator content block - so all IP fields, IP view list ul/li |
---|
86 | " |
---|
87 | > |
---|
88 | <xsl:param name="containerID" ibis:doc="Optional ID to be used for the container."/> |
---|
89 | <xsl:param name="contentContainerClass"/> |
---|
90 | <xsl:param name="additionalClasses" ibis:doc="Optional css class to append to the outermost element."/> |
---|
91 | |
---|
92 | <xsl:param name="contentBlockType" select="$ContentContainer.defaultContentBlockType" |
---|
93 | ibis:doc="Optional param to control the block type. Default is ContentContainer.defaultContentBlockType." |
---|
94 | /> |
---|
95 | <xsl:param name="expandableControlType" ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/> |
---|
96 | <xsl:param name="expandableContentShow" ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/> |
---|
97 | <xsl:param name="expandableControlName" |
---|
98 | ibis:doc="Optional param that is only needed when the expandableControlType |
---|
99 | is 'radio'. This results in a UI where only 1 expandable block |
---|
100 | will be displayed at a time (hence the radio input functionality). |
---|
101 | " |
---|
102 | /> |
---|
103 | <xsl:param name="expandableControlAccesskey" ibis:doc="Optional param that is a quick access key used for the expandable control."/> |
---|
104 | |
---|
105 | <xsl:param name="title" ibis:doc="Optional title text to be displayed"/> |
---|
106 | <xsl:param name="titleLevel" select="$ContentContainer.titleLevel" as="xs:integer" |
---|
107 | ibis:doc="Optional title level - html Hx element control. Defaults |
---|
108 | to ContentContainer.titleLevel, value of 0 turns off. |
---|
109 | " |
---|
110 | /> |
---|
111 | <xsl:param name="description" ibis:doc="Optional description to be placed in the HTML Hx element's title attribute."/> |
---|
112 | |
---|
113 | <xsl:param name="content" ibis:doc="Content which can include text and |
---|
114 | optional sub elements - content is simply copied into the output. |
---|
115 | If no content then the block is NOT created. |
---|
116 | " |
---|
117 | /> |
---|
118 | <xsl:param name="addWikiAttribute" select="$ContentContainer.addWikiAttributeToContentContainer" |
---|
119 | ibis:doc="boolean that controls if container should the wiki attribute added (so script can process for embedded wiki markup)." |
---|
120 | /> |
---|
121 | |
---|
122 | <!-- xsl:message select="concat('ContentContainer title level: ', $titleLevel, ', title: ', $title)"/ --> |
---|
123 | <xsl:choose> |
---|
124 | <xsl:when test="$contentBlockType = 'expandable'"> |
---|
125 | <xsl:call-template name="ContentContainer.expandable"> |
---|
126 | <xsl:with-param name="containerID" select="$containerID"/> |
---|
127 | <xsl:with-param name="contentContainerClass" select="if(0 != string-length($contentContainerClass)) then $contentContainerClass else $ContentContainer.expandableContentContainerClass"/> |
---|
128 | <xsl:with-param name="additionalClasses" select="$additionalClasses"/> |
---|
129 | <xsl:with-param name="title" select="$title"/> |
---|
130 | <xsl:with-param name="titleLevel" select="$titleLevel"/> |
---|
131 | <xsl:with-param name="description" select="$description"/> |
---|
132 | |
---|
133 | <xsl:with-param name="controlType" select="$expandableControlType"/> |
---|
134 | <xsl:with-param name="controlName" select="$expandableControlName"/> |
---|
135 | <xsl:with-param name="show" select="$expandableContentShow"/> |
---|
136 | |
---|
137 | <xsl:with-param name="content" select="$content"/> |
---|
138 | <xsl:with-param name="addWikiAttribute" select="$addWikiAttribute"/> |
---|
139 | </xsl:call-template> |
---|
140 | </xsl:when> |
---|
141 | <xsl:when test="$contentBlockType = 'fixed'"> |
---|
142 | <xsl:call-template name="ContentContainer.fixed"> |
---|
143 | <xsl:with-param name="containerID" select="$containerID"/> |
---|
144 | <xsl:with-param name="contentContainerClass" select="if(0 != string-length($contentContainerClass)) then $contentContainerClass else $ContentContainer.defaultFixedContentContainerClass"/> |
---|
145 | <xsl:with-param name="additionalClasses" select="$additionalClasses"/> |
---|
146 | <xsl:with-param name="title" select="$title"/> |
---|
147 | <xsl:with-param name="titleLevel" select="$titleLevel"/> |
---|
148 | <xsl:with-param name="description" select="$description"/> |
---|
149 | <xsl:with-param name="content" select="$content"/> |
---|
150 | <xsl:with-param name="addWikiAttribute" select="$addWikiAttribute"/> |
---|
151 | </xsl:call-template> |
---|
152 | </xsl:when> |
---|
153 | |
---|
154 | <!-- if not fixed or expandabale then inline - no content block container --> |
---|
155 | <xsl:otherwise> |
---|
156 | <xsl:call-template name="ContentContainer.title"> |
---|
157 | <xsl:with-param name="title" select="$title"/> |
---|
158 | <xsl:with-param name="titleLevel" select="$titleLevel"/> |
---|
159 | <xsl:with-param name="description" select="$description"/> |
---|
160 | </xsl:call-template> |
---|
161 | <xsl:apply-templates select="$content/(text() | *)" mode="ibis.copy"/> |
---|
162 | </xsl:otherwise> |
---|
163 | </xsl:choose> |
---|
164 | </xsl:template> |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | <xsl:template name="ContentContainer.fixed" |
---|
169 | ibis:doc="Non expandable fixed content block. Called directly or via the |
---|
170 | general contentBlock template. |
---|
171 | " |
---|
172 | > |
---|
173 | <xsl:param name="containerID" ibis:doc="Optional ID to be used for the container."/> |
---|
174 | <xsl:param name="contentContainerClass" select="$ContentContainer.defaultFixedContentContainerClass"/> |
---|
175 | <xsl:param name="additionalClasses" ibis:doc="optional css class appended to the blocks cc.ContentContainer value."/> |
---|
176 | |
---|
177 | <xsl:param name="title" ibis:doc="Optional block Hx elemenet title text."/> |
---|
178 | <xsl:param name="titleLevel" select="$ContentContainer.titleLevel" as="xs:integer"/> |
---|
179 | <xsl:param name="description" ibis:doc="Optional title on hover text."/> |
---|
180 | |
---|
181 | <xsl:param name="content" ibis:doc="Text string or HTML content to be displayed. |
---|
182 | If content is blank then this code does not do anything." |
---|
183 | /> |
---|
184 | <xsl:param name="addWikiAttribute" select="$ContentContainer.addWikiAttributeToContentContainer"/> |
---|
185 | |
---|
186 | <xsl:param name="contentContinerElementName" select="if(0 != string-length($title)) then 'section' else 'div'"/> |
---|
187 | |
---|
188 | <!-- |
---|
189 | <xsl:message select="concat('~~~~~~~~~~ conent contain fixed element, title:', $title, ', content element count: ', count($content/*))"/> |
---|
190 | <xsl:message select="$content"/> |
---|
191 | --> |
---|
192 | <xsl:if test="exists($content/*) or (0 != string-length($content))"> |
---|
193 | <xsl:element name="{$contentContinerElementName}"> |
---|
194 | <xsl:if test="(0 != string-length($contentContainerClass)) or (0 != string-length($additionalClasses))"> |
---|
195 | <xsl:attribute name="class" select="concat($contentContainerClass, ' ', $additionalClasses)"/> |
---|
196 | </xsl:if> |
---|
197 | <xsl:if test="0 != string-length($containerID)"><xsl:attribute name="id" select="$containerID"/></xsl:if> |
---|
198 | <xsl:if test="$addWikiAttribute = true()"><xsl:attribute name="wiki" select="'true'"/></xsl:if> |
---|
199 | <xsl:call-template name="ContentContainer.title"> |
---|
200 | <xsl:with-param name="title" select="$title"/> |
---|
201 | <xsl:with-param name="titleLevel" select="$titleLevel"/> |
---|
202 | <xsl:with-param name="description" select="$description"/> |
---|
203 | </xsl:call-template> |
---|
204 | <xsl:apply-templates select="$content/(text() | *)" mode="ibis.copy"/> |
---|
205 | </xsl:element> |
---|
206 | </xsl:if> |
---|
207 | </xsl:template> |
---|
208 | |
---|
209 | |
---|
210 | |
---|
211 | <xsl:template name="ContentContainer.expandable" |
---|
212 | ibis:doc="Provides ability to more easily embed an expandable content block |
---|
213 | into the page. Note that the approp CSS will need to be included. |
---|
214 | The control and container require an 'id' attribute which is created |
---|
215 | based on the supplied content element. The 'content' text() and sub |
---|
216 | elements will be ibis:copied into the assoc content container DIV. |
---|
217 | |
---|
218 | used everywhere - content is anything - lots of HTML. The convertCRsToBRs |
---|
219 | flag was only set to true for IP stuff that is also wiki so not needed. |
---|
220 | " |
---|
221 | > |
---|
222 | <xsl:param name="containerID" ibis:doc="Optional ID to be used for the container."/> |
---|
223 | <xsl:param name="contentContainerClass" select="$ContentContainer.expandableContentContainerClass"/> |
---|
224 | |
---|
225 | <xsl:param name="additionalClasses" |
---|
226 | ibis:doc="Optional class to be appended to the ExpandableContent |
---|
227 | container css class. Note that this string value can be a |
---|
228 | single css class or a series. |
---|
229 | " |
---|
230 | /> |
---|
231 | |
---|
232 | <xsl:param name="title" select="'Click here to show more content.'"/> |
---|
233 | <xsl:param name="titleLevel" select="$ContentContainer.titleLevel" as="xs:integer" |
---|
234 | ibis:doc="Optional title level - html Hx element control. Defaults |
---|
235 | to ContentContainer.titleLevel, value of 0 turns off. |
---|
236 | " |
---|
237 | /> |
---|
238 | <xsl:param name="description" select="concat('Show/hide selection list control for ', $title)" |
---|
239 | ibis:doc="Optional title on hover text." |
---|
240 | /> |
---|
241 | <xsl:param name="subTitleContent" ibis:doc="Optional text or content to be copied after the title string."/> |
---|
242 | |
---|
243 | <xsl:param name="controlType" select="$ContentContainer.expandableControlType" |
---|
244 | ibis:doc="Optional param that controls the type of control to build. |
---|
245 | Default is ContentContainer.expandableControlType which defaults |
---|
246 | to a 'checkbox'. Checkbox results in a click bar that opens/ |
---|
247 | closes the content container. If 'radio' and controlName is |
---|
248 | the same as another expandable block then only one container will |
---|
249 | be displayed at a time (hence the radio input functionality). |
---|
250 | " |
---|
251 | /> |
---|
252 | <xsl:param name="controlID" |
---|
253 | ibis:doc="Optional ID to be used for the input control. If no value |
---|
254 | then an ID is generated based on the content element. This param |
---|
255 | provides a mechanism to name the control for fine grained css. |
---|
256 | " |
---|
257 | /> |
---|
258 | <xsl:param name="controlName" select="$ContentContainer.expandableControlName" |
---|
259 | ibis:doc="Optional param that is only needed when the controlType is |
---|
260 | 'radio'. This results in a UI where only 1 expandable block |
---|
261 | will be displayed at a time (hence the radio input functionality). |
---|
262 | Defaults to ContentContainer.expandableControlName. |
---|
263 | " |
---|
264 | /> |
---|
265 | |
---|
266 | <xsl:param name="inputOnChangeAttribute" ibis:doc="input onchange attribute"/> |
---|
267 | |
---|
268 | <xsl:param name="accesskey" ibis:doc="Optional control's quick access key."/> |
---|
269 | <xsl:param name="show" select="false()" |
---|
270 | ibis:doc="Optional flag value that if true sets the input to 'checked' |
---|
271 | which results in the block being shown/expanded. Default=false. |
---|
272 | " |
---|
273 | /> |
---|
274 | |
---|
275 | <xsl:param name="content" ibis:doc="Text string or HTML content to be displayed. |
---|
276 | If content is blank then this code does not do anything." |
---|
277 | /> |
---|
278 | |
---|
279 | <xsl:param name="addWikiAttribute" select="$ContentContainer.addWikiAttributeToContentContainer"/> |
---|
280 | |
---|
281 | |
---|
282 | <!-- required values so if '' then needs to be set to something valid. --> |
---|
283 | <xsl:variable name="id" select="if(string-length($controlID) != 0) then $controlID else concat('expandableContentControl.', generate-id($content))"/> |
---|
284 | <xsl:variable name="controlType" select="if(string-length($controlType) != 0) then $controlType else 'checkbox'"/> |
---|
285 | <!-- |
---|
286 | <xsl:message select="concat('************ Title: ', $title, ' TL: ', $titleLevel, ' Add WIKI: ', $addWikiAttribute, ' TL test: ', boolean($titleLevel) and ($titleLevel != 0))"/> |
---|
287 | --> |
---|
288 | <xsl:if test="exists($content/*) or (string-length($content) != 0)"> |
---|
289 | <section class="ExpandableContent {$additionalClasses}"> |
---|
290 | <input id="{$id}" type="{$controlType}" class="Control"> |
---|
291 | <xsl:if test="$show"> |
---|
292 | <xsl:attribute name="checked" select="'checked'"/> |
---|
293 | </xsl:if> |
---|
294 | <xsl:if test="($controlType = 'radio') and (0 != string-length($controlName))"> |
---|
295 | <xsl:attribute name="name" select="$controlName"/> |
---|
296 | </xsl:if> |
---|
297 | <xsl:if test="0 != string-length($inputOnChangeAttribute)"> |
---|
298 | <xsl:attribute name="onchange" select="$inputOnChangeAttribute"/> |
---|
299 | </xsl:if> |
---|
300 | </input> |
---|
301 | <xsl:call-template name="ContentContainer.title"> |
---|
302 | <xsl:with-param name="titleLevel" select="$titleLevel"/> |
---|
303 | <xsl:with-param name="description" select="$description"/> |
---|
304 | <xsl:with-param name="titleContent"> |
---|
305 | <label for="{$id}" title="Expandable content control for {$title}" class="FontIcon"> |
---|
306 | <xsl:if test="boolean($accesskey)"> |
---|
307 | <xsl:attribute name="accesskey" select="$accesskey"/> |
---|
308 | </xsl:if> |
---|
309 | <xsl:value-of select="$title"/> |
---|
310 | <xsl:copy-of select="$subTitleContent"/> |
---|
311 | </label> |
---|
312 | </xsl:with-param> |
---|
313 | </xsl:call-template> |
---|
314 | |
---|
315 | <div class="{$contentContainerClass}"> |
---|
316 | <xsl:if test="$addWikiAttribute = true()"><xsl:attribute name="wiki" select="'true'"/></xsl:if> |
---|
317 | <xsl:apply-templates select="$content/(text() | *)" mode="ibis.copy"/> |
---|
318 | </div> |
---|
319 | </section> |
---|
320 | </xsl:if> |
---|
321 | </xsl:template> |
---|
322 | |
---|
323 | |
---|
324 | <xsl:template name="ContentContainer.contentBlockWithDelimitedTitleTextsNodesets" |
---|
325 | ibis:doc="Creates a titled content block that has delimited title texts |
---|
326 | nodes (with nodes delimited via the delimitedTitleTextsNodes template. |
---|
327 | |
---|
328 | Loops the nodesets with each nodeset being an optinoal [TITLE] |
---|
329 | and 1:n TEXT nodes. Each nodeset is contained within a new fixed |
---|
330 | content block and delimited via the delimiter param. |
---|
331 | |
---|
332 | 1:n fixedBlocks with each fixedBlock having delimited TEXT blocks. |
---|
333 | |
---|
334 | Used for OVERVIEW type blocks and others that have TITLE and 1:n TEXT blocks. |
---|
335 | Struct passed in: set of nodes */{[TITLE], (n)TEXTs} |
---|
336 | " |
---|
337 | > |
---|
338 | <xsl:param name="containerID" ibis:doc="Optional ID to be used for the container."/> |
---|
339 | <xsl:param name="additionalClasses" ibis:doc="Optional css class to add to the content container."/> |
---|
340 | |
---|
341 | <xsl:param name="contentBlockType" select="$ContentContainer.defaultContentBlockType" |
---|
342 | ibis:doc="Optional param to control the block type. Default is ContentContainer.defaultContentBlockType." |
---|
343 | /> |
---|
344 | <xsl:param name="expandableControlType" ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/> |
---|
345 | <xsl:param name="expandableContentShow" ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/> |
---|
346 | <xsl:param name="expandableControlName" |
---|
347 | ibis:doc="Optional param that is only needed when the expandableControlType |
---|
348 | is 'radio'. This results in a UI where only 1 expandable block |
---|
349 | will be displayed at a time (hence the radio input functionality). |
---|
350 | " |
---|
351 | /> |
---|
352 | <xsl:param name="expandableControlAccesskey" ibis:doc="Optional param that is a quick access key used for the expandable control."/> |
---|
353 | |
---|
354 | <xsl:param name="title" ibis:doc="Optional title text to be displayed"/> |
---|
355 | <xsl:param name="titleLevel" select="$ContentContainer.titleLevel" as="xs:integer"/> |
---|
356 | <xsl:param name="description" ibis:doc="Optional description to be placed in the HTML Hx element's title attribute."/> |
---|
357 | |
---|
358 | <xsl:param name="titleAndTextsNodeset" ibis:doc="actual content - series of contained */TITLE and TEXTs elements."/> |
---|
359 | <xsl:param name="titleAndTextsNodesetDelimiter"><br/></xsl:param> <!-- fixed blocks have a div container so 2 brs is too much --> |
---|
360 | <xsl:param name="skipTitleAndTextsNodesetDelimiterIfTitle" select="true()"/> |
---|
361 | <xsl:param name="textNodeDelimiter"><br/><br/></xsl:param> |
---|
362 | <xsl:param name="addWikiAttribute" select="$ContentContainer.addWikiAttributeToContentContainer" |
---|
363 | ibis:doc="boolean that controls if container should the wiki attribute added (so script can process for embedded wiki markup)." |
---|
364 | /> |
---|
365 | <!-- |
---|
366 | <xsl:copy-of select="$titleAndTextsNodeset"/> |
---|
367 | <xsl:message select="'================'"/> |
---|
368 | <xsl:message select="count($titleAndTextsNodeset)"/> |
---|
369 | <xsl:message select="$titleAndTextsNodeset"/> |
---|
370 | <xsl:message select="count($titleAndTextsNodeset/*/TEXT)"/> |
---|
371 | <xsl:message select="$titleAndTextsNodeset/*/TEXT"/> |
---|
372 | <xsl:message select="'================'"/> |
---|
373 | --> |
---|
374 | <xsl:call-template name="ContentContainer.contentBlock"> |
---|
375 | <xsl:with-param name="containerID" select="$containerID"/> |
---|
376 | <xsl:with-param name="additionalClasses" select="$additionalClasses"/> |
---|
377 | <xsl:with-param name="title" select="$title"/> |
---|
378 | <xsl:with-param name="titleLevel" select="$titleLevel"/> |
---|
379 | <xsl:with-param name="description" select="$description"/> |
---|
380 | |
---|
381 | <xsl:with-param name="contentBlockType" select="$contentBlockType"/> |
---|
382 | <xsl:with-param name="expandableControlType" select="$expandableControlType"/> |
---|
383 | <xsl:with-param name="expandableControlName" select="$expandableControlName"/> |
---|
384 | <xsl:with-param name="expandableContentShow" select="$expandableContentShow"/> |
---|
385 | |
---|
386 | <xsl:with-param name="addWikiAttribute" select="$addWikiAttribute"/> |
---|
387 | <xsl:with-param name="content"> |
---|
388 | <xsl:for-each select="$titleAndTextsNodeset"> |
---|
389 | <xsl:sort select="SORT_ODRER" order="ascending" data-type="number"/> |
---|
390 | <xsl:if test="(position() != 1) and not($skipTitleAndTextsNodesetDelimiterIfTitle and (string-length(TITLE) != 0))"><xsl:copy-of select="$titleAndTextsNodesetDelimiter"/></xsl:if> |
---|
391 | <xsl:call-template name="ContentContainer.fixedContentBlockWithDelimitedTextNodes"> |
---|
392 | <xsl:with-param name="titleLevel" |
---|
393 | select="if(0 < $titleLevel) then $titleLevel+1 else $ContentContainer.titleLevel+1" |
---|
394 | /> |
---|
395 | <xsl:with-param name="titleAndTextsNode" select="."/> |
---|
396 | <xsl:with-param name="textNodeDelimiter" select="$textNodeDelimiter"/> |
---|
397 | </xsl:call-template> |
---|
398 | </xsl:for-each> |
---|
399 | </xsl:with-param> |
---|
400 | </xsl:call-template> |
---|
401 | </xsl:template> |
---|
402 | |
---|
403 | |
---|
404 | <xsl:template name="ContentContainer.fixedContentBlockWithDelimitedTextNodes" |
---|
405 | ibis:doc="creates a fixed content block then calls the delimitedNodesetContent |
---|
406 | template which loops and delimits the TEXT nodes. |
---|
407 | |
---|
408 | Used by: contentBlockWithDelimitedTitleTextsNodesets |
---|
409 | " |
---|
410 | > |
---|
411 | <xsl:param name="titleLevel" select="$ContentContainer.titleLevel" as="xs:integer"/> |
---|
412 | <xsl:param name="titleAndTextsNode" ibis:doc="node with [TITLE] and 1-n TEXTs."/> |
---|
413 | <xsl:param name="textNodeDelimiter"><br/><br/></xsl:param> |
---|
414 | <xsl:param name="addWikiAttribute" select="$ContentContainer.addWikiAttributeToContentContainer" |
---|
415 | ibis:doc="boolean that controls if container should the wiki attribute added (so script can process for embedded wiki markup)." |
---|
416 | /> |
---|
417 | |
---|
418 | <xsl:call-template name="ContentContainer.fixed"> |
---|
419 | <xsl:with-param name="title" select="TITLE"/> |
---|
420 | <xsl:with-param name="titleLevel" select="$titleLevel"/> |
---|
421 | <xsl:with-param name="description" select="DESCRIPTION"/> |
---|
422 | <xsl:with-param name="addWikiAttribute" select="$addWikiAttribute"/> |
---|
423 | <xsl:with-param name="content"> |
---|
424 | <xsl:call-template name="ContentContainer.delimitedNodesetContent"> |
---|
425 | <xsl:with-param name="contentNodeset" select="TEXT"/> |
---|
426 | <xsl:with-param name="delimiter" select="$textNodeDelimiter"/> |
---|
427 | </xsl:call-template> |
---|
428 | </xsl:with-param> |
---|
429 | </xsl:call-template> |
---|
430 | </xsl:template> |
---|
431 | |
---|
432 | |
---|
433 | <xsl:template name="ContentContainer.delimitedNodesetContent" |
---|
434 | ibis:doc="Loops through nodeset (set of peer nodes), copies current node |
---|
435 | content and separates each node's content with the supplied delimiter |
---|
436 | (typically 2 CR's \n\n or 2 HTML BR elements. Default are 2 BR's. |
---|
437 | " |
---|
438 | > |
---|
439 | <xsl:param name="contentNodeset"/> |
---|
440 | <xsl:param name="delimiter"><br/><br/></xsl:param> |
---|
441 | |
---|
442 | <xsl:for-each select="$contentNodeset"> |
---|
443 | <xsl:if test="position() != 1"><xsl:copy-of select="$delimiter"/></xsl:if> |
---|
444 | <xsl:copy-of select="current()/text() | current()/*"/> |
---|
445 | </xsl:for-each> |
---|
446 | </xsl:template> |
---|
447 | |
---|
448 | |
---|
449 | <xsl:template name="ContentContainer.title" |
---|
450 | ibis:doc="Show title if specified. IF there is a title it should have an |
---|
451 | appropriate block title so an Hx unless specifically set to 0 which |
---|
452 | means to not use a Hx. If title and titleLevel is not specified then |
---|
453 | the ContentContainer.titleLevel is used. |
---|
454 | " |
---|
455 | > |
---|
456 | <xsl:param name="title" ibis:doc="Optional title text to be displayed"/> |
---|
457 | <xsl:param name="titleLevel" as="xs:integer" |
---|
458 | ibis:doc="Optional title level - html Hx element control. Defaults |
---|
459 | to ContentContainer.titleLevel, value of 0 turns off. |
---|
460 | " |
---|
461 | /> |
---|
462 | <xsl:param name="description" ibis:doc="Optional - used for Hx title attribute."/> |
---|
463 | <xsl:param name="titleContent" select="if($title instance of element()) then $title/text() else $title" |
---|
464 | ibis:doc="Allows for labels etc to be placed within the block title |
---|
465 | element. Defaults to the title parameter. |
---|
466 | " |
---|
467 | /> |
---|
468 | <xsl:message select="concat('ContentContainer.title level: ', $titleLevel, ', title: ', $title)"/> |
---|
469 | <xsl:message select="$titleContent"/> |
---|
470 | <!-- xsl:message select="concat('ContentContainer.title level: ', $titleLevel, ', titleContent: ', $titleContent)"/ --> |
---|
471 | |
---|
472 | <xsl:if test="0 != string-length(normalize-space(string($titleContent)))"> |
---|
473 | <xsl:choose> |
---|
474 | <xsl:when test="0 = $titleLevel"> |
---|
475 | <xsl:copy-of select="$titleContent"/> |
---|
476 | </xsl:when> |
---|
477 | <xsl:when test="0 < $titleLevel"> |
---|
478 | <xsl:element name="h{$titleLevel}"> |
---|
479 | <xsl:attribute name="title" select="$description"/> |
---|
480 | <xsl:copy-of select="$titleContent"/> |
---|
481 | </xsl:element> |
---|
482 | </xsl:when> |
---|
483 | <xsl:otherwise> |
---|
484 | <xsl:element name="h{$ContentContainer.titleLevel}"> |
---|
485 | <xsl:attribute name="title" select="$description"/> |
---|
486 | <xsl:copy-of select="$titleContent"/> |
---|
487 | </xsl:element> |
---|
488 | </xsl:otherwise> |
---|
489 | </xsl:choose> |
---|
490 | </xsl:if> |
---|
491 | </xsl:template> |
---|
492 | |
---|
493 | |
---|
494 | |
---|
495 | <!-- 6/12/2015 removed related template name="ContentContainer.carriageReturnToBRTag" |
---|
496 | Only called from ContentContainer.expandable IF convertCRsToBRs is set. |
---|
497 | Now this code is using wiki formatting so not using. |
---|
498 | --> |
---|
499 | |
---|
500 | </xsl:stylesheet> |
---|
501 | <!-- ============================= End of File ============================= --> |
---|