p5dkp.map.entities.xsl 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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:p5dkp.entities="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities.xsd"
  12. exclude-result-prefixes="xs"
  13. version="2.0">
  14. <xsl:output indent="yes"/>
  15. <xsl:strip-space elements="*"/>
  16. <xsl:param name="basedir"/>
  17. <xsl:param name="p5dkp:xsd" required="yes"/>
  18. <xsl:param name="debug"/>
  19. <xsl:param name="p5dkp.entities:element.name" select="'wymagania'"/>
  20. <xsl:param name="p5dkp.entities:element.keyscope" select="concat($p5dkp.entities:element.name,'.')"/>
  21. <xsl:param name="p5dkp.entities:element.entities__x3A___no" select="'wymagania_no'"/>
  22. <!-- <xsl:param name="p5dkp.entities:element.targetNamespace" select="'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities.wymagania.xsd'"/>
  23. <xsl:param name="p5dkp.entities:element.xsd" select="'file:/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities.wymagania.xsd'"/>-->
  24. <xsl:param name="p5dkp:basedir" required="yes"/>
  25. <xsl:include href="p5dkp.dita.xsl"/>
  26. <xsl:include href="../xsd_asserts/p5xsda.sort_elements.xsl"/>
  27. <xsl:template match="p5dkp:map.keys.xml" mode="p5dkp.entities:element.xml">
  28. <xsl:variable name="map.keys" select="root()"/>
  29. <xsl:element name="p5dkp:map.{$p5dkp.entities:element.name}.xml">
  30. <xsl:attribute name="xsi:schemaLocation" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd',' ',$p5dkp:xsd)"/>
  31. <!--<p5dkp:map.zadanie.xml xsi:schemaLocation="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd {$p5dkp:xsd}">-->
  32. <xsl:variable name="p5xsda:xs.sequence">
  33. <xsl:apply-templates mode="p5xsda:xs.sequence" select="doc($p5dkp:xsd)//group[@name=$p5dkp.entities:element.name]/sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  34. <xsl:with-param name="p5xsda:schemaLocation.basedir" select="$p5dkp:basedir"/>
  35. </xsl:apply-templates>
  36. </xsl:variable>
  37. <xsl:copy-of select="$p5xsda:xs.sequence" copy-namespaces="no"/>
  38. <xsl:for-each select=".//topicref[contains(@keyscope,$p5dkp.entities:element.keyscope) ]">
  39. <xsl:if test="number($debug) &gt; 2">
  40. <xsl:message>#41 found topicref
  41. <xsl:copy copy-namespaces="no">
  42. <xsl:copy-of select="@*" copy-namespaces="no"/>
  43. val:<xsl:value-of select="topicmeta//keyword/text()"/>
  44. </xsl:copy>
  45. </xsl:message>
  46. </xsl:if>
  47. <!--<xsl:variable name="tools" select="$map.keys//topicref[keydef[map.keys.eval[keys[ @map.keys.eval=current()/keydef[@keys='map.tools']/@keyref]]]]"/>-->
  48. <!--<xsl:variable name="tools" select="$map.keys//topicref[keydef[map.keys.eval[keys[ @map.keys.eval='tools.master_server.product_no']]]]"/>-->
  49. <!--<xsl:variable name="map.taskid" select="keydef[@keys='map.taskid']//keyword"/>-->
  50. <xsl:element name="p5dkp:{$p5dkp.entities:element.name}">
  51. <!--<p5dkp:zadanie>--> <!-- xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd" -->
  52. <xsl:copy-of select="@*"/>
  53. <xsl:copy-of select="keydef/map.keys.eval" copy-namespaces="no"/>
  54. <xsl:if test="number($debug) &gt; 10"><DEBUG><xsl:copy-of select="."/></DEBUG></xsl:if>
  55. <xsl:variable name="p5dkp:dita">
  56. <xsl:apply-templates mode="p5dkp:dita">
  57. <xsl:with-param name="keyscope" select="@keyscope"/>
  58. <xsl:with-param name="type" select="$p5dkp.entities:element.entities__x3A___no"/>
  59. </xsl:apply-templates>
  60. </xsl:variable>
  61. <xsl:call-template name="p5xsda:sort_elements">
  62. <xsl:with-param name="p5xsda:elements.local" select="$p5dkp:dita"/>
  63. <xsl:with-param name="p5xsda:xs.sequence" select="$p5xsda:xs.sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  64. </xsl:call-template>
  65. <xsl:call-template name="p5xsda:missing_elements">
  66. <xsl:with-param name="p5xsda:elements.local" select="$p5dkp:dita"/>
  67. <xsl:with-param name="p5xsda:xs.sequence" select="$p5xsda:xs.sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  68. </xsl:call-template>
  69. <!--<xsl:apply-templates mode="p5dkp:dita">
  70. <xsl:with-param name="keyscope" select="@keyscope"/>
  71. <xsl:with-param name="type" select="$p5dkp.entities:element.entities__x3A___no"/>
  72. </xsl:apply-templates>-->
  73. <!--</p5dkp:zadanie>-->
  74. </xsl:element>
  75. </xsl:for-each>
  76. <!--</p5dkp:map.zadanie.xml>-->
  77. </xsl:element>
  78. </xsl:template>
  79. <xsl:template mode="p5dkp.entities:element.xml" match="topicref">
  80. <xsl:message terminate="yes">#124 error - not allowed to be topicref structurized at the moment</xsl:message>
  81. </xsl:template>
  82. <xsl:template mode="p5dkp.entities:element.xml" match="keydef">
  83. <xsl:element name="{@keys}">
  84. <xsl:value-of select="topicmeta//keyword/text()"/>
  85. </xsl:element>
  86. </xsl:template>
  87. <xsl:template mode="p5dkp.entities:element.xml" match="text()|comment()"/>
  88. </xsl:stylesheet>