[Lxml-checkins] r32445 - lxml/branch/lxml-1.1/src/lxml/tests

scoder at codespeak.net scoder at codespeak.net
Mon Sep 18 15:54:43 CEST 2006


Author: scoder
Date: Mon Sep 18 15:54:41 2006
New Revision: 32445

Modified:
   lxml/branch/lxml-1.1/src/lxml/tests/test_xslt.py
Log:
new test case for xsl:message

Modified: lxml/branch/lxml-1.1/src/lxml/tests/test_xslt.py
==============================================================================
--- lxml/branch/lxml-1.1/src/lxml/tests/test_xslt.py	(original)
+++ lxml/branch/lxml-1.1/src/lxml/tests/test_xslt.py	Mon Sep 18 15:54:41 2006
@@ -385,6 +385,25 @@
         self.assert_("TEST TEST TEST" in [entry.message
                                           for entry in style.error_log])
 
+    def test_xslt_message_terminate(self):
+        xml = '<blah/>'
+        xslt = '''
+        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+          <xsl:template match="/">
+            <xsl:message terminate="yes">TEST TEST TEST</xsl:message>
+          </xsl:template>
+        </xsl:stylesheet>
+        '''
+
+        source = self.parse(xml)
+        styledoc = self.parse(xslt)
+        style = etree.XSLT(styledoc)
+        result = style.apply(source)
+        self.assertEqual('', style.tostring(result))
+        self.assertEqual('', str(result))
+        self.assert_("TEST TEST TEST" in [entry.message
+                                          for entry in style.error_log])
+
     def test_xslt_shortcut(self):
         tree = self.parse('<a><b>B</b><c>C</c></a>')
         style = self.parse('''\


More information about the lxml-checkins mailing list