XML   20

skinconf xsl

Guest on 18th July 2022 01:56:00 AM

  1. <!--
  2.  Copyright  The Apache Software Foundation or its licensors,
  3.  as applicable.
  4.  
  5.  Licensed under the Apache License, Version 2.0 (the "License");
  6.  you may not use this file except in compliance with the License.
  7.  You may obtain a copy of the License at
  8.  
  9.      http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.  Unless required by applicable law or agreed to in writing, software
  12.  distributed under the License is distributed on an "AS IS" BASIS,
  13.  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  See the License for the specific language governing permissions and
  15.  limitations under the License.
  16. -->
  17. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  18. <xsl:template match="skinconfig">
  19. <xsl:if test="not(colors)">
  20. <colors>
  21. <!--  Lenya  -->
  22. <color name="header" value="#ffffff"/>
  23. <color name="tab-selected" value="#4C6C8F" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
  24. <color name="tab-unselected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
  25. <color name="subtab-selected" value="#4C6C8F" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
  26. <color name="subtab-unselected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
  27. <color name="heading" value="#E5E4D9"/>
  28. <color name="subheading" value="#E5E4D9"/>
  29. <color name="published" value="#4C6C8F" font="#FFFFFF"/>
  30. <color name="feedback" value="#4C6C8F" font="#FFFFFF" align="center"/>
  31. <color name="navstrip" value="#E5E4D9" font="#000000"/>
  32. <color name="toolbox" value="#CFDCED" font="#000000"/>
  33. <color name="border" value="#999999"/>
  34. <color name="menu" value="#4C6C8F" font="#ffffff" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
  35. <color name="menuheading" value="#cfdced" font="#000000"/>
  36. <color name="searchbox" value="#E5E4D9" font="#000000"/>
  37. <color name="dialog" value="#E5E4D9" font="#000000"/>
  38. <color name="body" value="#ffffff"/>
  39. <color name="table" value="#ccc"/>
  40. <color name="table-cell" value="#ffffff"/>
  41. <color name="highlight" value="#ffff00"/>
  42. <color name="fixme" value="#cc6600"/>
  43. <color name="note" value="#006699"/>
  44. <color name="warning" value="#990000"/>
  45. <color name="code" value="#003366"/>
  46. <color name="footer" value="#E5E4D9"/>
  47. </colors>
  48. </xsl:if>
  49. <xsl:copy>
  50. <xsl:copy-of select="@*"/>
  51. <xsl:copy-of select="node()[not(name(.)='colors')]"/>
  52. <xsl:apply-templates select="colors"/>
  53. </xsl:copy>
  54. </xsl:template>
  55. <xsl:template match="colors">
  56. <xsl:copy>
  57. <xsl:copy-of select="@*"/>
  58. <xsl:copy-of select="node()[name(.)='color']"/>
  59. <xsl:if test="not(color[@name='header'])">
  60. <color name="header" value="#FFFFFF"/>
  61. </xsl:if>
  62. <xsl:if test="not(color[@name='tab-selected'])">
  63. <color name="tab-selected" value="#4C6C8F" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
  64. </xsl:if>
  65. <xsl:if test="not(color[@name='tab-unselected'])">
  66. <color name="tab-unselected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
  67. </xsl:if>
  68. <xsl:if test="not(color[@name='subtab-selected'])">
  69. <color name="subtab-selected" value="#4C6C8F" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
  70. </xsl:if>
  71. <xsl:if test="not(color[@name='subtab-unselected'])">
  72. <color name="subtab-unselected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
  73. </xsl:if>
  74. <xsl:if test="not(color[@name='heading'])">
  75. <color name="heading" value="#E5E4D9"/>
  76. </xsl:if>
  77. <xsl:if test="not(color[@name='subheading'])">
  78. <color name="subheading" value="#E5E4D9"/>
  79. </xsl:if>
  80. <xsl:if test="not(color[@name='published'])">
  81. <color name="feedback" value="#4C6C8F" font="#FFFFFF" align="center"/>
  82. </xsl:if>
  83. <xsl:if test="not(color[@name='published'])">
  84. <color name="published" value="#4C6C8F" font="#FFFFFF"/>
  85. </xsl:if>
  86. <xsl:if test="not(color[@name='navstrip'])">
  87. <color name="navstrip" value="#E5E4D9" font="#000000"/>
  88. </xsl:if>
  89. <xsl:if test="not(color[@name='toolbox'])">
  90. <color name="toolbox" value="#CFDCED" font="#000000"/>
  91. </xsl:if>
  92. <xsl:if test="not(color[@name='border'])">
  93. <color name="border" value="#999999"/>
  94. </xsl:if>
  95. <xsl:if test="not(color[@name='menu'])">
  96. <color name="menu" value="#4C6C8F" font="#ffffff" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
  97. </xsl:if>
  98. <xsl:if test="not(color[@name='menuheading'])">
  99. <color name="menuheading" value="#cfdced" font="#000000"/>
  100. </xsl:if>
  101. <xsl:if test="not(color[@name='searchbox'])">
  102. <color name="searchbox" value="#E5E4D9" font="#000000"/>
  103. </xsl:if>
  104. <xsl:if test="not(color[@name='dialog'])">
  105. <color name="dialog" value="#E5E4D9" font="#000000" link="#000000" vlink="#000000" hlink="#000000"/>
  106. </xsl:if>
  107. <xsl:if test="not(color[@name='body'])">
  108. <color name="body" value="#ffffff"/>
  109. </xsl:if>
  110. <xsl:if test="not(color[@name='table'])">
  111. <color name="table" value="#ccc"/>
  112. </xsl:if>
  113. <xsl:if test="not(color[@name='table-cell'])">
  114. <color name="table-cell" value="#ffffff"/>
  115. </xsl:if>
  116. <xsl:if test="not(color[@name='highlight'])">
  117. <color name="highlight" value="#ffff00"/>
  118. </xsl:if>
  119. <xsl:if test="not(color[@name='fixme'])">
  120. <color name="fixme" value="#c60"/>
  121. </xsl:if>
  122. <xsl:if test="not(color[@name='note'])">
  123. <color name="note" value="#069"/>
  124. </xsl:if>
  125. <xsl:if test="not(color[@name='warning'])">
  126. <color name="warning" value="#900"/>
  127. </xsl:if>
  128. <xsl:if test="not(color[@name='code'])">
  129. <color name="code" value="#a5b6c6"/>
  130. </xsl:if>
  131. <xsl:if test="not(color[@name='footer'])">
  132. <color name="footer" value="#E5E4D9"/>
  133. </xsl:if>
  134. </xsl:copy>
  135. </xsl:template>
  136. </xsl:stylesheet>

Raw Paste


Login or Register to edit or fork this paste. It's free.