Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <tests>
  2. <testcases id="1">
  3. <command value="copy">
  4. <files value="$$path$$/1.txt $$path$$/2.txt" />
  5. </testcases>
  6.  
  7. <?xml version="1.0" encoding="utf-8"?>
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
  10. >
  11. <xsl:param name="path">##MISSING##</xsl:param>
  12. <xsl:output method="xml" indent="yes" encoding="utf-8"/>
  13.  
  14. <xsl:template match="@* | node()">
  15. <xsl:copy>
  16. <xsl:apply-templates select="@* | node()"/>
  17. </xsl:copy>
  18. </xsl:template>
  19. <xsl:template match="@*">
  20. <xsl:param name="find">$$project$$</xsl:param>
  21. <xsl:variable name="attribute-name" select="name()"/>
  22. <xsl:choose>
  23. <xsl:when test="contains(., $find)">
  24. <xsl:attribute name="{$attribute-name}">
  25. <xsl:value-of select="concat(substring-before(., $find), $path, substring-after(., $find))"/>
  26. </xsl:attribute>
  27. </xsl:when>
  28. <xsl:otherwise>
  29. <xsl:copy>
  30. <xsl:apply-templates select="@* | node()"/>
  31. </xsl:copy>
  32. </xsl:otherwise>
  33. </xsl:choose>
  34. </xsl:template>
  35.  
  36. <tests>
  37. <testcases id="1">
  38. <command value="copy">
  39. <files value="E:/test/1.txt $$path$$/2.txt" />
  40. </testcases>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement