images.xsl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  5. exclude-result-prefixes="xs"
  6. version="2.0">
  7. <!-- Do parsowania <images>
  8. <image x="1" y="1">
  9. <xmin>6525000.91100983333333333345</xmin>
  10. <ymin>6012859.46859783333333333345</ymin>
  11. <xmax>6525085.57767650000000000000</xmax>
  12. <ymax>6012944.13526450000000000000</ymax>
  13. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-1-1.png</file>
  14. </image>
  15. <image x="2" y="1">
  16. <xmin>6525080.57767650000000000000</xmin>
  17. <ymin>6012859.46859783333333333345</ymin>
  18. <xmax>6525165.24434316666666666655</xmax>
  19. <ymax>6012944.13526450000000000000</ymax>
  20. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-1-2.png</file>
  21. </image>
  22. <image x="1" y="2">
  23. <xmin>6525000.91100983333333333345</xmin>
  24. <ymin>6012939.13526450000000000000</ymin>
  25. <xmax>6525085.57767650000000000000</xmax>
  26. <ymax>6013023.80193116666666666655</ymax>
  27. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-2-1.png</file>
  28. </image>
  29. <image x="2" y="2">
  30. <xmin>6525080.57767650000000000000</xmin>
  31. <ymin>6012939.13526450000000000000</ymin>
  32. <xmax>6525165.24434316666666666655</xmax>
  33. <ymax>6013023.80193116666666666655</ymax>
  34. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-2-2.png</file>
  35. </image>
  36. </images> -->
  37. <xsl:output indent="yes"/>
  38. <xsl:strip-space elements="*"/>
  39. <xsl:template mode="system_cache__appinfo:images" match="images">
  40. <xsl:param name="fileindex" required="yes"/> <!-- ex. 3161_IN7_MK_BAZA_DYSTRYBUCJI - is related dir in dita dir with images -->
  41. <xsl:apply-templates mode="system_cache__appinfo:images">
  42. <xsl:with-param name="fileindex" select="$fileindex"/>
  43. </xsl:apply-templates>
  44. </xsl:template>
  45. <xsl:template mode="system_cache__appinfo:images" match="image[@x and @y]">
  46. <xsl:param name="fileindex" required="yes"/>
  47. <image href="{$fileindex}/{$fileindex}_image-{@x}-{@y}.png" width="300"/>
  48. </xsl:template>
  49. <xsl:template mode="system_cache__appinfo:images" match="*">
  50. <xsl:message terminate="yes">#56 not expected data - needed @x and @y to be in xml image element: correct is:
  51. <image x="1" y="1">
  52. <xmin>6525000.91100983333333333345</xmin>
  53. <ymin>6012859.46859783333333333345</ymin>
  54. <xmax>6525085.57767650000000000000</xmax>
  55. <ymax>6012944.13526450000000000000</ymax>
  56. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-1-1.png</file>
  57. </image>
  58. </xsl:message>
  59. </xsl:template>
  60. <xsl:template mode="system_cache__appinfo:images__write" match="*">
  61. <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
  62. <gml_to_image srcfile="{$ditadir}/{$fileindex}.gml" dstfile="{$ditadir}/{$fileindex}.png.xml" fileindex="{$fileindex}" ditadir="{$ditadir}"/>
  63. </xsl:template>
  64. <xsl:template mode="system_cache__appinfo:images__read" match="*">
  65. <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
  66. <!-- to read and parse system_cache__appinfo:images -->
  67. <!--<xsl:variable name="fileindex" select="concat(ID,'_',local-name())"/>-->
  68. <xsl:choose>
  69. <xsl:when test="doc-available(concat($ditadir,'/',$fileindex,'.png.xml'))">
  70. <xsl:apply-templates mode="system_cache__appinfo:images" select="doc(concat($ditadir,'/',$fileindex,'.png.xml'))">
  71. <xsl:with-param name="fileindex" select="$fileindex"/>
  72. </xsl:apply-templates>
  73. </xsl:when>
  74. <xsl:otherwise>
  75. <xsl:comment>#83 doc not aviable <xsl:value-of select="concat($ditadir,'/',$fileindex,'.png.xml')"/></xsl:comment>
  76. <xsl:message>#83 doc not aviable <xsl:value-of select="concat($ditadir,'/',$fileindex,'.png.xml')"/></xsl:message>
  77. </xsl:otherwise>
  78. </xsl:choose>
  79. </xsl:template>
  80. </xsl:stylesheet>