p5dkp.keyscope.xsl 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
  5. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  6. xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
  7. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
  9. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  10. xmlns:p5xsda="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsd_asserts/p5xsda.xsd"
  11. xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"
  12. xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
  13. exclude-result-prefixes="xs ditaarch"
  14. version="2.0">
  15. <xsl:template name="p5dkp:keyscope">
  16. <xsl:param name="keyscope"/>
  17. <xsl:param name="keyscope.attr"/>
  18. <xsl:param name="keys.attr" />
  19. <xsl:choose>
  20. <xsl:when test=" string-length($keyscope.attr) &gt; 0">
  21. <keyscope>
  22. <xsl:for-each select="$keyscope/keyscope/key">
  23. <xsl:copy-of select="."/>
  24. </xsl:for-each>
  25. <xsl:choose>
  26. <xsl:when test="string-length($keys.attr) &gt; 0 and 1=2">
  27. <xsl:for-each select="tokenize($keyscope.attr,' ')"><key><xsl:value-of select="."/>.<xsl:value-of select="$keys.attr"/></key></xsl:for-each>
  28. </xsl:when>
  29. <xsl:otherwise>
  30. <xsl:for-each select="tokenize($keyscope.attr,' ')"><key><xsl:value-of select="."/></key></xsl:for-each>
  31. </xsl:otherwise>
  32. </xsl:choose>
  33. </keyscope>
  34. </xsl:when>
  35. <xsl:otherwise>
  36. <xsl:copy-of select="$keyscope"/>
  37. </xsl:otherwise>
  38. </xsl:choose>
  39. </xsl:template>
  40. <xsl:function name="p5dkp:keyscope.init">
  41. <keyscope>
  42. <key/>
  43. </keyscope>
  44. </xsl:function>
  45. </xsl:stylesheet>