hazard-d-attr.xsl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. See the accompanying license.txt file for applicable licenses.
  5. -->
  6. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  7. version="2.0">
  8. <!-- Source: https://www.nema.org/Standards/ComplimentaryDocuments/ANSI%20Z535_1-2017%20CONTENTS%20AND%20SCOPE.pdf -->
  9. <xsl:variable name="hazard.ansi.red" select="'#C8102E'"/>
  10. <xsl:variable name="hazard.ansi.orange" select="'#FF8200'"/>
  11. <xsl:variable name="hazard.ansi.yellow" select="'#FFD100'"/>
  12. <xsl:variable name="hazard.ansi.green" select="'#007B5F'"/>
  13. <xsl:variable name="hazard.ansi.blue" select="'#0072CE'"/>
  14. <xsl:variable name="hazard.ansi.purple" select="'#6D2077'"/>
  15. <!-- Source: https://en.wikipedia.org/wiki/ISO_3864 -->
  16. <xsl:variable name="hazard.iso.red" select="'#9B2423'"/>
  17. <xsl:variable name="hazard.iso.yellow" select="'#F9A800'"/>
  18. <xsl:variable name="hazard.iso.green" select="'#237F52'"/>
  19. <xsl:variable name="hazard.iso.blue" select="'#005387'"/>
  20. <xsl:attribute-set name="hazardstatement">
  21. <xsl:attribute name="width">100%</xsl:attribute>
  22. <xsl:attribute name="space-before">8pt</xsl:attribute>
  23. <xsl:attribute name="space-after">10pt</xsl:attribute>
  24. <xsl:attribute name="border-style">solid</xsl:attribute>
  25. <xsl:attribute name="border-color">black</xsl:attribute>
  26. <xsl:attribute name="border-width">5pt</xsl:attribute>
  27. </xsl:attribute-set>
  28. <xsl:attribute-set name="hazardstatement.cell">
  29. <xsl:attribute name="start-indent">0pt</xsl:attribute>
  30. <xsl:attribute name="border-style">solid</xsl:attribute>
  31. <xsl:attribute name="border-color">black</xsl:attribute>
  32. <xsl:attribute name="border-width">2pt</xsl:attribute>
  33. <xsl:attribute name="padding">3pt</xsl:attribute>
  34. <xsl:attribute name="keep-together">always</xsl:attribute>
  35. </xsl:attribute-set>
  36. <xsl:attribute-set name="hazardstatement.title" use-attribute-sets="hazardstatement.cell common.title">
  37. <xsl:attribute name="number-columns-spanned">2</xsl:attribute>
  38. <xsl:attribute name="text-transform">uppercase</xsl:attribute>
  39. <xsl:attribute name="font-weight">bold</xsl:attribute>
  40. <xsl:attribute name="font-size">1.5em</xsl:attribute>
  41. <xsl:attribute name="text-align">center</xsl:attribute>
  42. </xsl:attribute-set>
  43. <xsl:attribute-set name="hazardstatement.title.danger">
  44. <xsl:attribute name="color">white</xsl:attribute>
  45. <xsl:attribute name="background-color" select="$hazard.ansi.red"/>
  46. <xsl:attribute name="font-style">normal</xsl:attribute>
  47. </xsl:attribute-set>
  48. <xsl:attribute-set name="hazardstatement.title.warning">
  49. <xsl:attribute name="background-color" select="$hazard.ansi.orange"/>
  50. <xsl:attribute name="font-style">normal</xsl:attribute>
  51. </xsl:attribute-set>
  52. <xsl:attribute-set name="hazardstatement.title.caution">
  53. <xsl:attribute name="background-color" select="$hazard.ansi.yellow"/>
  54. <xsl:attribute name="font-style">normal</xsl:attribute>
  55. </xsl:attribute-set>
  56. <xsl:attribute-set name="hazardstatement.title.notice">
  57. <xsl:attribute name="color">white</xsl:attribute>
  58. <xsl:attribute name="font-style">italic</xsl:attribute>
  59. <xsl:attribute name="background-color" select="$hazard.ansi.blue"/>
  60. </xsl:attribute-set>
  61. <xsl:attribute-set name="hazardstatement.image" use-attribute-sets="hazardstatement.cell">
  62. <xsl:attribute name="text-align">center</xsl:attribute>
  63. </xsl:attribute-set>
  64. <xsl:attribute-set name="hazardstatement.image.column">
  65. <xsl:attribute name="column-width">6em</xsl:attribute>
  66. </xsl:attribute-set>
  67. <xsl:attribute-set name="hazardstatement.content" use-attribute-sets="hazardstatement.cell">
  68. </xsl:attribute-set>
  69. <xsl:attribute-set name="hazardstatement.content.column">
  70. </xsl:attribute-set>
  71. <xsl:attribute-set name="messagepanel">
  72. </xsl:attribute-set>
  73. <xsl:attribute-set name="consequence">
  74. </xsl:attribute-set>
  75. <xsl:attribute-set name="howtoavoid">
  76. </xsl:attribute-set>
  77. <xsl:attribute-set name="typeofhazard">
  78. </xsl:attribute-set>
  79. <xsl:attribute-set name="hazardsymbol" use-attribute-sets="image">
  80. <xsl:attribute name="content-width">4em</xsl:attribute>
  81. <xsl:attribute name="width">4em</xsl:attribute>
  82. </xsl:attribute-set>
  83. </xsl:stylesheet>