validateHTMLContent.xts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: HTS
  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. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  9. <!-- Validate the HTML entered. Only what you can enter from UI editor is valid
  10. anything outside what is listed in the XSD file will fail vlaidation and will
  11. not be able to save. Currently the failure is not passed to UI to rollback the
  12. action, however a yellow Error div is shown.
  13. -->
  14. <xts:block id="response" type="exec" mode="interpret" processor="XSLT" condition=".[/root/interactions/param[@name='subject'] or /root/interactions/param[@name='message_HTML']]" mandatory="false">
  15. <xts:logicsheet path="logicsheets/portal.xsl"/>
  16. <xsl:stylesheet version="1.0"
  17. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  18. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  19. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  20. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  21. xmlns:encodingUtils="com.cognos.portal.utils.EncodingUtils"
  22. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  23. exclude-result-prefixes="xsl xos pf xtsext encodingUtils cm">
  24. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  25. <pf:variables/>
  26. <pf:gen-icon/>
  27. <xsl:template match="/">
  28. <xts:sequence>
  29. <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
  30. <xts:param name="noNamespaceSchemaLocation">portal/emailOptions/schemas/richEditBodyFull.xsd</xts:param>
  31. <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
  32. <xts:transform src="portal/emailOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
  33. <!-- We need to wrap it with body. The html comming from UI is just a small html fragment.-->
  34. <body>
  35. <xsl:value-of select="/root/interactions/param[@name='message_HTML']" disable-output-escaping="yes"/>
  36. </body>
  37. </xts:transform>
  38. </xts:transform>
  39. <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
  40. <xts:param name="noNamespaceSchemaLocation">portal/emailOptions/schemas/richEditBodyFull.xsd</xts:param>
  41. <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
  42. <xts:transform src="portal/emailOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
  43. <!-- We need to wrap it with body. The html comming from UI is just a small html fragment.-->
  44. <body>
  45. <xsl:value-of select="/root/interactions/param[@name='subject']" disable-output-escaping="yes"/>
  46. </body>
  47. </xts:transform>
  48. </xts:transform>
  49. </xts:sequence>
  50. </xsl:template>
  51. </xsl:stylesheet>
  52. </xts:block>
  53. </xts:morphlet>