p5dkp.local.idref.xsl 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. exclude-result-prefixes="xs"
  12. version="2.0">
  13. <xsl:output indent="yes"/>
  14. <xsl:strip-space elements="*"/>
  15. <xsl:param name="basedir"/>
  16. <xsl:template mode="p5dkp:map.budzet_rola.xml.local p5dkp:map.budzet_rola.xml.local.idref" match="text()">
  17. <xsl:copy-of select="."/>
  18. </xsl:template>
  19. <xsl:template mode="p5dkp:map.budzet_rola.xml.local p5dkp:map.budzet_rola.xml.local.idref" match="missing_elements" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsd_asserts/p5xsda.xsd">
  20. <xsl:copy-of select="."/>
  21. </xsl:template>
  22. <xsl:template mode="p5dkp:map.budzet_rola.xml.local p5dkp:map.budzet_rola.xml.local.idref" match="*">
  23. <xsl:copy>
  24. <xsl:choose>
  25. <xsl:when test="* or text() or @p5dkp:id or @href">
  26. <xsl:apply-templates mode="#current" select="@*"/>
  27. <xsl:apply-templates mode="#current"/>
  28. </xsl:when>
  29. <xsl:when test="@keyref">
  30. <xsl:variable name="keyscope.field" select="tokenize(@keyref,'\.')[ position() = last()]"/>
  31. <xsl:variable name="keyscope" select=" substring-before(@keyref,concat('.',$keyscope.field))"/>
  32. <xsl:message>#167 evaluating $@keyref=<xsl:value-of select="@keyref"/> to $keyscope.field = <xsl:value-of select="$keyscope.field"/>;
  33. - evaluated <xsl:value-of select="$p5dkp.map.keys//topicref[@keyscope=$keyscope]/keydef[@keys = $keyscope.field]//keyword/text()"/></xsl:message>
  34. <xsl:apply-templates mode="#current" select="@*"/>
  35. <xsl:value-of select="$p5dkp.map.keys//topicref[@keyscope=$keyscope]/keydef[@keys = $keyscope.field]//keyword/text()"/>
  36. </xsl:when>
  37. <xsl:when test="../@href">
  38. <xsl:variable name="keyscope.field" select="tokenize(@keyref,'\.')[ position() = last()]"/>
  39. <xsl:variable name="keyscope" select=" substring-before(@keyref,concat('.',$keyscope.field))"/>
  40. <xsl:message>#167-B copying @href=<xsl:value-of select="../@href"/> $keyscope.field = <xsl:value-of select="$keyscope.field"/>; </xsl:message>
  41. <xsl:copy-of select="../@href"/>
  42. <!--<xsl:apply-templates mode="#current" select="../@*"/>-->
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <xsl:message terminate="yes">#173 unantended <xsl:value-of select="name()"/> ; <xsl:copy-of select="@*"/> value=<xsl:value-of select="text()"/> ; parent=<xsl:value-of select="../name()"/>/<xsl:copy-of select="../@*"></xsl:copy-of></xsl:message>
  46. </xsl:otherwise>
  47. </xsl:choose>
  48. </xsl:copy>
  49. </xsl:template>
  50. <xsl:template mode="p5dkp:map.budzet_rola.xml.local.idref p5dkp:map.budzet_rola.xml.local" match="@*">
  51. <xsl:copy-of select="."/>
  52. </xsl:template>
  53. <xsl:template mode="p5dkp:map.budzet_rola.xml.local.idref" match="@p5dkp:id">
  54. <xsl:attribute name="p5dkp:idref" select="."/>
  55. </xsl:template>
  56. <xsl:template mode="p5dkp:map.budzet_rola.xml.local.idref p5dkp:map.budzet_rola.xml.local" match="@keyref">
  57. <xsl:attribute name="keyref" select="."/>
  58. <xsl:attribute name="p5dkp:idref" select="."/>
  59. </xsl:template>
  60. <xsl:template mode="p5dkp:map.budzet_rola.xml.local p5dkp:map.budzet_rola.xml.local.idref" match="map.keys.eval">
  61. <!--<xsl:choose>
  62. <xsl:when test="$debug">
  63. <xsl:copy-of select="."/>
  64. </xsl:when>
  65. </xsl:choose>-->
  66. </xsl:template>
  67. </xsl:stylesheet>