mergeRoutingTableAndRoutingHints.xslt 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  13. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  14. <xsl:template match="/routingHints">
  15. <xsl:variable name="objectType">
  16. <xsl:value-of select="/routingHints/objectType"/>
  17. </xsl:variable>
  18. <routingHints>
  19. <xsl:for-each select="/routingHints/cm:queryResponse/cm:queryReply/*/cm:routingHints/cm:string[. != '']">
  20. <xsl:copy-of select="."/>
  21. </xsl:for-each>
  22. <xsl:for-each select="/routingHints/cm:queryResponse/cm:queryReply[position()=last()]/cm:configuration/cm:routingTable/cm:routingTableEntry/cm:rule/cm:routingHintObject[cm:objectClass=$objectType]/cm:value">
  23. <xsl:element name="string" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  24. <xsl:value-of select="."/>
  25. </xsl:element>
  26. </xsl:for-each>
  27. </routingHints>
  28. </xsl:template>
  29. </xsl:stylesheet>