generateMetricsRequestBody.xslt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 2005, 2010
  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. <!--
  13. Generates a list of properties using the capability passed in and the metadata
  14. <root>
  15. <metadata>
  16. metadata from the server
  17. </metadata>
  18. <capability>
  19. the type of properties we want to get
  20. </capability>
  21. </root>
  22. -->
  23. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2" xmlns:nemo="http://developer.cognos.com/nemo" exclude-result-prefixes="xsl wsrf-rp nemo">
  24. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  25. <xsl:template match="/">
  26. <response>
  27. <metricsRequestBody>
  28. <wsrf-rp:GetMultipleResourceProperties>
  29. <xsl:for-each select="/root/input[@name='capabilities']/capabilities/capability">
  30. <xsl:variable name="capability" select="."/>
  31. <xsl:for-each select="/root/input[@name='metadataResponse']/wsrf-rp:GetMultipleResourcePropertiesResponse/nemo:MetadataDescriptor/nemo:Property[nemo:Capability = string($capability) or not($capability)]">
  32. <wsrf-rp:ResourceProperty>
  33. <xsl:value-of select="nemo:Name"/>
  34. </wsrf-rp:ResourceProperty>
  35. </xsl:for-each>
  36. </xsl:for-each>
  37. </wsrf-rp:GetMultipleResourceProperties>
  38. </metricsRequestBody>
  39. </response>
  40. </xsl:template>
  41. </xsl:stylesheet>