post-get-targetLocations.xslt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2010, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. This stylesheet merges the parent target location query result with the corresponding target search path
  10. It is meant to be use in the checkTargetLocationExistence block of new_deployment2.xts
  11. -->
  12. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  15. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  16. <xsl:template match="/root" >
  17. <xsl:apply-templates select="*"/>
  18. </xsl:template>
  19. <xsl:template match="/root/cm:searchPath" >
  20. </xsl:template>
  21. <xsl:template match="cm:queryResponse">
  22. <xsl:copy>
  23. <xsl:copy-of select="@*"/>
  24. <xsl:for-each select="cm:queryReply">
  25. <xsl:copy>
  26. <xsl:variable name="currentIndex" select="position()"/>
  27. <xsl:if test="/root/cm:searchPath[$currentIndex]">
  28. <xsl:attribute name="package" ><xsl:value-of select="/root/cm:searchPath[$currentIndex]"/></xsl:attribute>
  29. </xsl:if>
  30. <xsl:apply-templates/>
  31. </xsl:copy>
  32. </xsl:for-each>
  33. </xsl:copy>
  34. </xsl:template>
  35. <xsl:template match="@*|node()">
  36. <xsl:copy>
  37. <xsl:apply-templates select="@*|node()"/>
  38. </xsl:copy>
  39. </xsl:template>
  40. </xsl:stylesheet>