Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. version="1.0">
  4. <xsl:output method="text"/>
  5. <xsl:strip-space elements="node"/>
  6. <xsl:strip-space elements="*"/>
  7.  
  8. <xsl:variable name="newline"><xsl:text>&#x0a;</xsl:text></xsl:variable>
  9. <xsl:variable name="sep"><xsl:text>&#x7f;</xsl:text></xsl:variable>
  10.  
  11. <xsl:template match="changes/product">
  12.  
  13. <!-- ustawienie zmiennych -->
  14. <!--EXTERNAL_ID-->
  15. <xsl:choose>
  16. <xsl:when test="string-length(@index)">
  17. <xsl:value-of select="substring(normalize-space(@index),0,100)"/>
  18. </xsl:when>
  19. <xsl:otherwise>
  20. <xsl:text>\N</xsl:text>
  21. </xsl:otherwise>
  22. </xsl:choose>
  23. <xsl:value-of select="$sep"/>
  24. <!--NAME-->
  25. <xsl:choose>
  26. <xsl:when test="string-length(@code)">
  27. <xsl:value-of select="substring(normalize-space(@code),0,100)"/>
  28. </xsl:when>
  29. <xsl:otherwise>
  30. <xsl:text>NoName</xsl:text>
  31. </xsl:otherwise>
  32. </xsl:choose>
  33. <xsl:value-of select="$sep"/>
  34. <!--NEW_PRODUCT-->
  35. <xsl:value-of select="1"/>
  36. <xsl:value-of select="$sep"/>
  37. <!--AVAILABLE-->
  38. <xsl:value-of select="1"/>
  39. <xsl:value-of select="$sep"/>
  40. <!--BESTSELLER-->
  41. <xsl:value-of select="1"/>
  42. <xsl:value-of select="$sep"/>
  43. <!--BRAND-->
  44. <xsl:text>\N</xsl:text>
  45. <xsl:value-of select="$sep"/>
  46. <!--CATEGORIES-->
  47. <xsl:text>\N</xsl:text>
  48. <xsl:value-of select="$sep"/>
  49. <!--CATEGORY_MAIN-->
  50. <xsl:text>\N</xsl:text>
  51. <xsl:value-of select="$sep"/>
  52. <!--DESCRIPTION-->
  53. <xsl:text>\N</xsl:text>
  54. <xsl:value-of select="$sep"/>
  55. <!--DETAIL_1-->
  56. <xsl:choose>
  57. <xsl:when test="string-length(@id)">
  58. <xsl:value-of select="substring(normalize-space(@id),0,100)"/>
  59. </xsl:when>
  60. <xsl:otherwise>
  61. <xsl:text>\N</xsl:text>
  62. </xsl:otherwise>
  63. </xsl:choose>
  64. <xsl:value-of select="$sep"/>
  65. <!--DETAIL_2-->
  66. <xsl:choose>
  67. <xsl:when test="string-length(@code)">
  68. <xsl:value-of select="substring(normalize-space(@code),0,100)"/>
  69. </xsl:when>
  70. <xsl:otherwise>
  71. <xsl:text>\N</xsl:text>
  72. </xsl:otherwise>
  73. </xsl:choose>
  74. <xsl:value-of select="$sep"/>
  75. <!--DETAIL_3-->
  76. <xsl:text>\N</xsl:text>
  77. <xsl:value-of select="$sep"/>
  78. <!--DETAIL_4-->
  79. <xsl:text>\N</xsl:text>
  80. <xsl:value-of select="$sep"/>
  81. <!--DETAIL_5-->
  82. <xsl:text>\N</xsl:text>
  83. <xsl:value-of select="$sep"/>
  84. <!--MANUFACTURER-->
  85. <xsl:text>\N</xsl:text>
  86. <xsl:value-of select="$sep"/>
  87. <!--PRICE-->
  88. <xsl:text>\N</xsl:text>
  89. <xsl:value-of select="$sep"/>
  90. <!--PRICE_PROMO-->
  91. <xsl:text>\N</xsl:text>
  92. <xsl:value-of select="$sep"/>
  93. <!--QUANTITY-->
  94. <xsl:value-of select="0"/>
  95. <xsl:value-of select="$sep"/>
  96. <!--URL_PRODUCT-->
  97. <xsl:text>\N</xsl:text>
  98. <xsl:value-of select="$sep"/>
  99. <!--URL_IMG-->
  100. <xsl:text>\N</xsl:text>
  101. <xsl:value-of select="$sep"/>
  102. <!--GENDER-->
  103. <xsl:text>\N</xsl:text>
  104. <xsl:value-of select="$sep"/>
  105. <!--URL_CATEGORY-->
  106. <xsl:text>\N</xsl:text>
  107. <xsl:value-of select="$sep"/>
  108. <!--URL_CATEGORY_MARK-->
  109. <xsl:text>\N</xsl:text>
  110. <xsl:value-of select="$sep"/>
  111. <!--POPULARITY-->
  112. <xsl:text>\N</xsl:text>
  113. <xsl:value-of select="$sep"/>
  114. <!--SEASON-->
  115. <xsl:text>\N</xsl:text>
  116. <xsl:value-of select="$sep"/>
  117. <!--COLOR-->
  118. <xsl:text>\N</xsl:text>
  119. <xsl:value-of select="$sep"/>
  120. <!--ADDITIONAL_IMAGE-->
  121. <xsl:text>\N</xsl:text>
  122. <xsl:value-of select="$sep"/>
  123. <!--INT_DETAIL1-->
  124. <xsl:text>\N</xsl:text>
  125. <xsl:value-of select="$sep"/>
  126. <!--INT_DETAIL2-->
  127. <xsl:text>\N</xsl:text>
  128. <xsl:value-of select="$sep"/>
  129. <!--DEC_DETAIL1-->
  130. <xsl:text>\N</xsl:text>
  131. <xsl:value-of select="$sep"/>
  132. <!--array-->
  133. <xsl:text>\N</xsl:text>
  134. <!-- koniec -->
  135. <xsl:value-of select="$newline"/>
  136. </xsl:template>
  137. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement