d2a.ditamap.PRODUCT.xsl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
  5. xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
  6. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  7. xmlns:d2a="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita-to-ant/d2a.xsd"
  8. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
  10. exclude-result-prefixes="xs d2a"
  11. version="2.0">
  12. <xsl:output indent="yes"/>
  13. <xsl:strip-space elements="*"/>
  14. <xsl:template match="task" mode="d2a:PRODUCT.new_ant_project.child" >
  15. <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
  16. <d2a:PRODUCT.new_ant_project>
  17. <project
  18. basedir="{d2a:basedir($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,$d2a:basedir_ROOT_DITA_KEYREF)}"
  19. name="{$d2a.new_module.INPUT}.PRODUCT">
  20. <xsl:variable name="p5dg:filename.d2a.new_module.INPUT" select="$p5dkp:ditafiles.xml/ancestor-or-self::*[@p5dkp:true.path][1]/p5dg:filename(@p5dkp:true.path)"/>
  21. <property name="{$d2a.new_module.INPUT}.basedir" location="{$p5dkp:ditafiles.xml/ancestor-or-self::*[@p5dkp:true.path][1]/p5dg:filepath.dir(@p5dkp:true.path)}"/>
  22. <property name="{$d2a.new_module.INPUT}.temp" > <!-- location="{d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*,'public_html__WPS_Functions.WPS_Functions.temp')}" -->
  23. <xsl:copy-of select="d2a:ditamap.INPUT.temp.xmlatt($p5dkp:ditafiles.xml,'location')" copy-namespaces="no"/>
  24. <!--<TEST location="{d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*,'public_html__WPS_Functions.WPS_Functions.temp')}">
  25. </TEST>-->
  26. <!-- example <property name="html2image.temp" location="/opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/html2image"/> -->
  27. <!--<xsl:attribute name="location">
  28. <xsl:value-of select="d2a:keyref.element.root($p5dkp:ditafiles.xml/ancestor-or-self::*,'public_html__WPS_Functions.WPS_Functions.temp')"/>
  29. <!-\-<xsl:text>/</xsl:text>-\-><xsl:value-of select="$p5dkp:ditafiles.xml/ancestor-or-self::*[@p5dkp:true.path][1]/p5dg:filename(p5dg:filepath.dir(@p5dkp:true.path))"/>
  30. </xsl:attribute>-->
  31. <!--<TEST>
  32. <xsl:copy-of select="$p5dkp:ditafiles.xml/ancestor-or-self::*[@p5dkp:true.path][1]/p5dg:filename(p5dg:filepath.dir(@p5dkp:true.path))"/>
  33. </TEST>-->
  34. <!--<test>
  35. <xsl:for-each select="$p5dkp:ditafiles.xml/ancestor-or-self::*">
  36. <name name="{name()}" href="{@href}" >
  37. <xsl:for-each select="descendant-or-self::*">
  38. <desc name="{name()}">
  39. <xsl:choose>
  40. <xsl:when test="@map.keys.eval='public_html__WPS_Functions.WPS_Functions.temp'">
  41. <OOKS>found</OOKS>
  42. </xsl:when>
  43. </xsl:choose>
  44. </desc>
  45. </xsl:for-each>
  46. </name>
  47. </xsl:for-each>
  48. </test>-->
  49. </property>
  50. <!-- public_html__WPS_Functions.WPS_Functions.temp -->
  51. <xsl:apply-templates mode="d2a:PRODUCT.new_ant_project.child.task">
  52. <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
  53. </xsl:apply-templates>
  54. </project>
  55. </d2a:PRODUCT.new_ant_project>
  56. </xsl:template>
  57. <xsl:template match="steps|step|cmd|apiname|info|syntaxdiagram|groupcomp" mode="d2a:PRODUCT.new_ant_project.child.task">
  58. <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
  59. <xsl:comment>#64 <xsl:value-of select="name()"/></xsl:comment>
  60. <xsl:apply-templates mode="#current">
  61. <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
  62. </xsl:apply-templates>
  63. </xsl:template>
  64. <xsl:template match="var[varname[@keyref]]" mode="d2a:PRODUCT.new_ant_project.child.task">
  65. <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
  66. <xsl:comment>#72__AC <xsl:value-of select="name()"/> ;
  67. <xsl:value-of select="$p5dkp:ditafiles.xml/ancestor-or-self::*[ descendant-or-self::keys[@map.keys.eval = current()/varname/@keyref]]/ancestor-or-self::p5dkp:ditafiles.file[1]/concat('id=',@id,' @format=',@format,' @scope=',@scope)"/></xsl:comment>
  68. <xsl:choose>
  69. <xsl:when test="contains(d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,varname/@keyref),'.dita')"> <!-- $p5dkp:ditafiles.xml/ancestor-or-self::*[ descendant-or-self::keys[@map.keys.eval = current()/varname/@keyref]]/ancestor-or-self::p5dkp:ditafiles.file[1][( not(@format) and not(@scope='external') and not(@format='ditamap') )] -->
  70. <xsl:comment>#76 problem - missing force keyref wrong --window-size <xsl:value-of select="$p5dkp:ditafiles.xml/ancestor-or-self::*[descendant-or-self::keys[@map.keys.eval = current()/varname/@keyref]]/@format"/></xsl:comment>
  71. <!--<xsl:choose>
  72. <xsl:when test="$p5dkp:ditafiles.xml/ancestor-or-self::*[descendant-or-self::keys[@map.keys.eval = current()/varname/@keyref]]/ancestor-or-self::p5dkp:ditafiles.file[1]/descendant-or-self::keyword[1]">-->
  73. <!--<xsl:value-of select="$p5dkp:ditafiles.xml/ancestor-or-self::*[descendant-or-self::keys[@map.keys.eval = current()/varname/@keyref]]/ancestor-or-self::p5dkp:ditafiles.file[1]/descendant-or-self::keyword[1]"/>-->
  74. <xsl:comment>#82 used keyword</xsl:comment>
  75. <property name="{varname/@keyref}">
  76. <xsl:copy-of select="d2a:keyref.keyword_prio($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,varname/@keyref)"/>
  77. </property>
  78. <!--</xsl:when>
  79. </xsl:choose>-->
  80. </xsl:when>
  81. <xsl:otherwise>
  82. <xsl:comment>#82-B due to not @format=dita not keyword</xsl:comment>
  83. <property name="{varname/@keyref}">
  84. <xsl:copy-of select="d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,varname/@keyref)"/>
  85. </property>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. <xsl:apply-templates mode="#current">
  89. <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
  90. </xsl:apply-templates>
  91. </xsl:template>
  92. <xsl:template match="cmd[apiname[@keyref]]" mode="d2a:PRODUCT.new_ant_project.child.task">
  93. <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
  94. <xsl:comment>#72__AC <xsl:value-of select="name()"/> ;
  95. <xsl:value-of select="$p5dkp:ditafiles.xml/ancestor-or-self::*[ descendant-or-self::keys[@map.keys.eval = current()/apiname/@keyref]]/ancestor-or-self::p5dkp:ditafiles.file[1]/concat('id=',@id,' @format=',@format,' @scope=',@scope)"/></xsl:comment>
  96. <xsl:choose>
  97. <xsl:when test="contains(d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,apiname/@keyref),'.dita')"> <!-- $p5dkp:ditafiles.xml/ancestor-or-self::*[ descendant-or-self::keys[@map.keys.eval = current()/varname/@keyref]]/ancestor-or-self::p5dkp:ditafiles.file[1][( not(@format) and not(@scope='external') and not(@format='ditamap') )] -->
  98. <xsl:comment>#76-1110 problem - missing force keyref wrong --window-size <xsl:value-of select="$p5dkp:ditafiles.xml/ancestor-or-self::*[descendant-or-self::keys[@map.keys.eval = current()/apiname/@keyref]]/@format"/></xsl:comment>
  99. <xsl:comment>#82-1110 used keyword</xsl:comment>
  100. <property name="{apiname/@keyref}">
  101. <xsl:copy-of select="d2a:keyref.keyword_prio($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,apiname/@keyref)"/>
  102. </property>
  103. <!--</xsl:when>
  104. </xsl:choose>-->
  105. </xsl:when>
  106. <xsl:otherwise>
  107. <xsl:comment>#82-B-1100 due to not @format=dita not keyword</xsl:comment>
  108. <property name="{apiname/@keyref}">
  109. <xsl:copy-of select="d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,apiname/@keyref)"/>
  110. </property>
  111. </xsl:otherwise>
  112. </xsl:choose>
  113. <xsl:apply-templates mode="#current">
  114. <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
  115. </xsl:apply-templates>
  116. </xsl:template>
  117. <xsl:template mode="d2a:PRODUCT.new_ant_project.child.task.abbreviated-form" match="text()">
  118. <xsl:comment>#109 <xsl:value-of select="."/> ;</xsl:comment>
  119. </xsl:template>
  120. <xsl:template match="abbreviated-form|kwd|var" mode="d2a:PRODUCT.new_ant_project.child.task">
  121. <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
  122. <xsl:apply-templates select="@*" mode="d2a:PRODUCT.new_ant_project.child.task.abbreviated-form">
  123. <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
  124. </xsl:apply-templates>
  125. <xsl:apply-templates mode="d2a:PRODUCT.new_ant_project.child.task.abbreviated-form">
  126. <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
  127. </xsl:apply-templates>
  128. </xsl:template>
  129. <xsl:template match="@keyref" mode="d2a:PRODUCT.new_ant_project.child.task.abbreviated-form">
  130. <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
  131. <xsl:comment>#35 todo keyref resolve</xsl:comment>
  132. <property name="{.}">
  133. <xsl:copy-of select="d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,.)" copy-namespaces="no"/>
  134. <!--<xsl:attribute name="value"><!-\-<xsl:for-each select="$p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*[map.keys.eval[keys[@map.keys.eval='module.bocian-graph-to-html.graph-part-first.html']]][1]">
  135. <xsl:value-of select="@href"/>
  136. </xsl:for-each>-\->
  137. <xsl:value-of select="d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,.)"/>
  138. </xsl:attribute>-->
  139. </property>
  140. </xsl:template>
  141. <xsl:template match="@*" mode="d2a:PRODUCT.new_ant_project.child.task.abbreviated-form"/>
  142. <xsl:template match="*" mode="d2a:PRODUCT.new_ant_project.child" >
  143. <xsl:comment>#27 bypassed name=<xsl:value-of select="name()"/> mode="d2a:PRODUCT.new_ant_project.child"</xsl:comment>
  144. </xsl:template>
  145. <xsl:template match="text()" mode="d2a:PRODUCT.new_ant_project.child" >
  146. <xsl:comment>#27-A bypassed name=<xsl:value-of select="name()"/> mode="d2a:PRODUCT.new_ant_project.child"</xsl:comment>
  147. </xsl:template>
  148. <xsl:template mode="d2a:PRODUCT.new_ant_project.child.task.abbreviated-form" match="*"/>
  149. <xsl:template mode="d2a:PRODUCT.new_ant_project.child d2a:PRODUCT.new_ant_project.child.task" match="text()|comment()"/>
  150. </xsl:stylesheet>