bcgtht.tree_to_dita.src_fid_analys.xsl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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:gml="http://www.opengis.net/gml"
  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:bcgtht="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/bocian-graph-to-html/bcgtht.xsd"
  8. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY"
  10. xmlns:p5="https://biuro.biall-net.pl/wfs"
  11. xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"
  12. xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"
  13. xmlns:default_db__x3A__BI_audit_KRS="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS"
  14. xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI"
  15. xmlns:default_db__x3A__BI_audit_MSIG="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG"
  16. xmlns:default_db__x3A__BI_audit_CEIDG="https://biuro.biall-net.pl/wfs/default_db/BI_audit_CEIDG"
  17. xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
  18. xmlns:default_db__x3A__BI_audit_KRS_person="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_person"
  19. xmlns:default_db__x3A__BI_audit_taxpayer="https://biuro.biall-net.pl/wfs/default_db/BI_audit_taxpayer"
  20. xmlns:default_db__x3A__BI_audit_KRS_company="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_company"
  21. xmlns:default_db__x3A__BI_audit_MSIG_company="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_company"
  22. xmlns:default_db__x3A__TERYT_adresy="https://biuro.biall-net.pl/wfs/default_db/TERYT_adresy"
  23. xmlns:default_db__x3A__BI_audit_MSIG_person="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_person"
  24. xmlns:default_db__x3A__BI_audit_operational_raport_note="https://biuro.biall-net.pl/wfs/default_db/BI_audit_operational_raport_note"
  25. xmlns:default_db__x3A__BI_audit_MSIG_address="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_address"
  26. exclude-result-prefixes="xs"
  27. version="2.0">
  28. <xsl:output indent="yes"/>
  29. <xsl:strip-space elements="*"/>
  30. <xsl:template mode="bcgtht:src_fid_analys" match="*">
  31. <xsl:message terminate="yes">#33 unantended mode="bcgtht:src_fid_analys" for element <xsl:value-of select="name()"/> ; </xsl:message>
  32. </xsl:template>
  33. <xsl:template mode="bcgtht:src_fid_analys" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA">
  34. <src_fid_analys>
  35. <xsl:comment>#38 test</xsl:comment>
  36. <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid">
  37. <xsl:variable name="src.current-grouping-key" select="current-grouping-key()"/>
  38. <src_fid key="{current-grouping-key()}" pos="{position()}" count="{count(current-group())}"> <!-- fid="{BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]/@fid}" -->
  39. <xsl:copy copy-namespaces="no">
  40. <xsl:copy-of select="@*"/>
  41. <xsl:comment>#43 will row objs for obj <xsl:value-of select="*[1]/name()"/> @fid=<xsl:value-of select="*[1]/@fid"/> *[1]/*[1]/@fid=<xsl:value-of select="*[1]/*[1]/@fid"/></xsl:comment>
  42. <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]">
  43. <xsl:copy copy-namespaces="no">
  44. <xsl:copy-of select="@*"/>
  45. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names">
  46. <xsl:with-param name="addelement" select="true()"/>
  47. </xsl:apply-templates>
  48. </xsl:copy>
  49. </xsl:for-each>
  50. </xsl:copy>
  51. <xsl:for-each-group select="current-group()" group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]/@fid">
  52. <xsl:choose>
  53. <xsl:when test="current-grouping-key()=$src.current-grouping-key">
  54. <src.current-grouping-key same="1">
  55. <xsl:comment>#58 $src.current-grouping-key=<xsl:value-of select="$src.current-grouping-key"/>; </xsl:comment>
  56. </src.current-grouping-key>
  57. </xsl:when>
  58. <xsl:when test="system_cache__dita:bocian.bypass.elements(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[@fid=current-grouping-key()]/local-name())">
  59. <dst_fid key="{current-grouping-key()}" prec.cnt="{count(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[*[@fid = current-grouping-key()]]/preceding-sibling::*)}" pos="{position()}"> <!-- fid="{BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]/@fid}" -->
  60. <xsl:copy copy-namespaces="no">
  61. <xsl:copy-of select="@*"/>
  62. <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[*[@fid=current-grouping-key()]][1]">
  63. <xsl:copy copy-namespaces="no">
  64. <xsl:copy-of select="@*"/>
  65. <xsl:for-each select="*[1]">
  66. <xsl:copy copy-namespaces="no">
  67. <xsl:copy-of select="@*"/>
  68. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names">
  69. <xsl:with-param name="addelement" select="true()"/>
  70. </xsl:apply-templates>
  71. </xsl:copy>
  72. </xsl:for-each>
  73. </xsl:copy>
  74. </xsl:for-each>
  75. </xsl:copy>
  76. <xsl:for-each-group select="current-group()/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[*[@fid = current-grouping-key()][1]]/preceding-sibling::*[ *[1][system_cache__dita:bocian.bypass.elements( local-name())]]" group-by="*[1]/@fid">
  77. <preceding-sibling key="{current-grouping-key()}" fid="{*[1]/@fid}" pos="{position()}">
  78. <!--<follow>
  79. <xsl:for-each-group select="current-group()/following-sibling::*/*[1][system_cache__dita:bocian.bypass.elements(local-name())]" group-by="@fid">
  80. <xsl:copy>
  81. <xsl:copy-of select="@*"/>
  82. </xsl:copy>
  83. </xsl:for-each-group>
  84. </follow>-->
  85. <xsl:for-each select="parent::*">
  86. <xsl:copy copy-namespaces="no">
  87. <xsl:copy-of select="@*"/>
  88. <xsl:for-each select="*[*[@fid=current-grouping-key()]][1]">
  89. <xsl:copy copy-namespaces="no">
  90. <xsl:copy-of select="@*"/>
  91. <xsl:copy-of select="@*"/>
  92. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names">
  93. <xsl:with-param name="addelement" select="true()"/>
  94. </xsl:apply-templates>
  95. </xsl:copy>
  96. </xsl:for-each>
  97. </xsl:copy>
  98. </xsl:for-each>
  99. </preceding-sibling>
  100. </xsl:for-each-group>
  101. <xsl:for-each-group select="current-group()/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[*[@fid = current-grouping-key()][1]]/following-sibling::*[ *[1][system_cache__dita:bocian.bypass.elements( local-name())]]" group-by="*[1]/@fid">
  102. <following-sibling key="{current-grouping-key()}" fid="{*[1]/@fid}" pos="{position()}" prec.cnt="{count(preceding-sibling::*)}" prec.cnt.min="{min(count(current-group()/preceding-sibling::*))}" prec.cnt.max="{max(count(current-group()/preceding-sibling::*))}" >
  103. <!--<prec>
  104. <xsl:for-each-group select="current-group()/preceding-sibling::*/*[1][system_cache__dita:bocian.bypass.elements(local-name())]" group-by="@fid">
  105. <xsl:copy>
  106. <xsl:copy-of select="@*"/>
  107. </xsl:copy>
  108. </xsl:for-each-group>
  109. </prec>-->
  110. <xsl:for-each select="parent::*">
  111. <xsl:copy copy-namespaces="no">
  112. <xsl:copy-of select="@*"/>
  113. <xsl:for-each select="*[*[@fid=current-grouping-key()]][1]">
  114. <xsl:copy copy-namespaces="no">
  115. <xsl:copy-of select="@*"/>
  116. <xsl:copy-of select="@*"/>
  117. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names">
  118. <xsl:with-param name="addelement" select="true()"/>
  119. </xsl:apply-templates>
  120. </xsl:copy>
  121. </xsl:for-each>
  122. </xsl:copy>
  123. </xsl:for-each>
  124. </following-sibling>
  125. </xsl:for-each-group>
  126. </dst_fid>
  127. </xsl:when>
  128. <xsl:otherwise>
  129. <system_cache__dita:bocian.bypass.elements key="{current-grouping-key()}" pos="{position()}"/>
  130. </xsl:otherwise>
  131. </xsl:choose>
  132. </xsl:for-each-group>
  133. </src_fid>
  134. </xsl:for-each-group>
  135. </src_fid_analys>
  136. </xsl:template>
  137. </xsl:stylesheet>