extractDatasourceMetadata.xslt 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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) 2009 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"
  13. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  14. exclude-result-prefixes="xsl xts">
  15. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  16. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  17. <xsl:variable name="queryServiceEquivalent" select="/root/datasources/datasource[value=key('env-param', 'm_connection_type')]/queryServiceEquivalent"></xsl:variable>
  18. <xsl:template match="/root">
  19. <datasources>
  20. <xsl:copy-of select="/root/datasources/datasource[value=key('env-param', 'm_connection_type')]"/>
  21. </datasources>
  22. <xsl:if test="/root/getJDBCDatasource='true' and $queryServiceEquivalent!=''">
  23. <jdbcdatasources>
  24. <xsl:copy-of select="/root/datasources/datasource[value=$queryServiceEquivalent]"/>
  25. </jdbcdatasources>
  26. </xsl:if>
  27. </xsl:template>
  28. </xsl:stylesheet>