|
220 | 220 | gmd:keyword//*[@locale = concat('#', $guiLangId)][. != '']/replace(text(), ',', ',,')
|
221 | 221 | else gmd:keyword/*[1][. != '']/replace(text(), ',', ',,'), ',')"/>
|
222 | 222 |
|
| 223 | + |
223 | 224 | <!-- Define the list of transformation mode available. -->
|
| 225 | + <xsl:variable name="listOfTransformation" |
| 226 | + select="if ($thesaurusConfig/@transformations) |
| 227 | + then tokenize($thesaurusConfig/@transformations, ',') |
| 228 | + else if ($thesaurusList/@defaultTransformation) |
| 229 | + then ($thesaurusList/@defaultTransformation) |
| 230 | + else ()" |
| 231 | + as="xs:string*"/> |
| 232 | + |
224 | 233 | <xsl:variable name="transformations"
|
225 | 234 | as="xs:string"
|
226 |
| - select="if ($thesaurusConfig/@transformations != '') |
227 |
| - then $thesaurusConfig/@transformations |
228 |
| - else 'to-iso19139-keyword,to-iso19139-keyword-with-anchor,to-iso19139-keyword-as-xlink'"/> |
229 |
| - |
230 |
| - <!-- Get current transformation mode based on XML fragment analysis --> |
| 235 | + select="if (count($listOfTransformation) > 0) |
| 236 | + then string-join($listOfTransformation, ',') |
| 237 | + else if ($isXlinkEnabled) |
| 238 | + then 'to-iso19139-keyword,to-iso19139-keyword-with-anchor,to-iso19139-keyword-as-xlink' |
| 239 | + else 'to-iso19139-keyword,to-iso19139-keyword-with-anchor'"/> |
| 240 | + |
| 241 | + <!-- Current transformation is the editor configuration if only one mode is allowed |
| 242 | + and if not then the mode is based on the XML fragment analysis --> |
231 | 243 | <xsl:variable name="transformation"
|
232 |
| - select="if (parent::node()/@xlink:href) then 'to-iso19139-keyword-as-xlink' |
233 |
| - else if (count(gmd:keyword/gmx:Anchor) > 0) |
234 |
| - then 'to-iso19139-keyword-with-anchor' |
235 |
| - else 'to-iso19139-keyword'"/> |
| 244 | + select="if (count($listOfTransformation) = 1) |
| 245 | + then $listOfTransformation[1] |
| 246 | + else if (parent::node()/@xlink:href) |
| 247 | + then 'to-iso19139-keyword-as-xlink' |
| 248 | + else if (count(gmd:keyword/gmx:Anchor) > 0) |
| 249 | + then 'to-iso19139-keyword-with-anchor' |
| 250 | + else 'to-iso19139-keyword'"/> |
| 251 | + |
236 | 252 |
|
237 | 253 | <xsl:variable name="parentName" select="name(..)"/>
|
238 | 254 |
|
|
0 commit comments