append_page_layout.xslt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  15. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  16. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  17. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  18. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  19. exclude-result-prefixes="xsl cm xts cps xos xtsext">
  20. <xsl:output method="xml" encoding="UTF-8" version="1.0" indent="no"/>
  21. <xsl:template match="/root">
  22. <xts:sequence>
  23. <xts:append>
  24. <xsl:choose>
  25. <!-- If we are editing an existing page then read the layout -->
  26. <xsl:when test="/root/cm:queryResponse/cm:queryReply[1]/cm:pagelet/cm:layout">
  27. <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/cm:pagelet/cm:layout" disable-output-escaping="yes"/>
  28. </xsl:when>
  29. <xsl:otherwise>
  30. <xts:transform src="portal/mypages/transform/gen_pagelet_layout.xslt" processor="XSLT">
  31. <xsl:copy-of select="/root/env"/>
  32. </xts:transform>
  33. </xsl:otherwise>
  34. </xsl:choose>
  35. </xts:append>
  36. </xts:sequence>
  37. </xsl:template>
  38. </xsl:stylesheet>