[Checkins] SVN: z3c.pt/trunk/ XML namespace attribute is now always printed for root tag.

Malthe Borch mborch at gmail.com
Tue Sep 2 12:01:11 EDT 2008


Log message for revision 90715:
  XML namespace attribute is now always printed for root tag.

Changed:
  U   z3c.pt/trunk/CHANGES.txt
  U   z3c.pt/trunk/src/z3c/pt/genshi.txt
  U   z3c.pt/trunk/src/z3c/pt/i18n.txt
  U   z3c.pt/trunk/src/z3c/pt/template.txt
  U   z3c.pt/trunk/src/z3c/pt/tests/test_edgecases.py
  U   z3c.pt/trunk/src/z3c/pt/translation.py
  U   z3c.pt/trunk/src/z3c/pt/translation.txt
  U   z3c.pt/trunk/src/z3c/pt/zpt.txt

-=-
Modified: z3c.pt/trunk/CHANGES.txt
===================================================================
--- z3c.pt/trunk/CHANGES.txt	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/CHANGES.txt	2008-09-02 16:01:10 UTC (rev 90715)
@@ -15,6 +15,8 @@
 
   Features
 
+- XML namespace attribute is now always printed for root tag. [malthe]
+  
 - Allow standard HTML entities. [malthe]
   
 - Added compiler option to specify an implicit doctype; this is

Modified: z3c.pt/trunk/src/z3c/pt/genshi.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/genshi.txt	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/src/z3c/pt/genshi.txt	2008-09-02 16:01:10 UTC (rev 90715)
@@ -21,7 +21,7 @@
   ...     <b>Foo</b>
   ...   </py:if>
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <div>
       <p>Foo</p>
     </div>
@@ -57,7 +57,7 @@
   ...     </div>
   ...   </div>
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <div>
       <span>1</span>
       <div>
@@ -85,7 +85,7 @@
   ...    <li>${item}</li>
   ...  </py:for>
   ... </ul>""")
-  <ul>
+  <ul xmlns="http://www.w3.org/1999/xhtml">
     <li>0</li>
   <li>1</li>
   <li>2</li>
@@ -109,7 +109,7 @@
   ...  ${goodbye('world')}
   ...  ${goodbye('everyone')}  
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
    <p class="greeting">
      Hello, world!
    </p>
@@ -142,7 +142,7 @@
   ...       "${q["quote"]} <em>${q["author"]}</em>
   ...   </blockquote>
   ... </div>""", quote=quote)
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>2 7 12</span>
     4 3 9
     <blockquote>
@@ -159,7 +159,7 @@
   ...   <li class="expand" py:attrs="{'class': 'collapse'}">Bar</li>
   ...   <li class="expand" py:attrs="d">Bar</li>
   ... </ul>""", d=dict({'class': u'\u1234'}))
-  <ul>
+  <ul xmlns="http://www.w3.org/1999/xhtml">
     <li class="collapse">Bar</li>
     <li class="ሴ">Bar</li>
   </ul>
@@ -172,7 +172,7 @@
   ...   <span py:content="'Hello, world!'" />
   ...   <span py:replace="'Goodbye, world!'" />
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>Hello, world!</span>
     Goodbye, world!
   </div>
@@ -184,7 +184,7 @@
   ...      xmlns:py="http://genshi.edgewall.org/">
   ...    <span py:strip="True"><b>foo</b></span>
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
      <b>foo</b>
   </div>
 
@@ -202,7 +202,7 @@
   ...   <greeting name="dude" />
   ...   <farewell name="dude" />
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>
       Hello, dude!
     </span>
@@ -226,7 +226,7 @@
   ...   <span style="position: ${'abs'}olute"
   ...         class="my-${int('test') | 'class'} item${'Last'}" />
   ... </div>""", ltr={'letter': 'A', 'href': '?title=A', 'iscurrent': 'current'})
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <span>interpolation</span>is convenient!
       <span>abc d</span>
       <span class="Hello World!" />
@@ -242,7 +242,7 @@
   ...      xmlns:py="http://genshi.edgewall.org/">
   ...   <span py:with="y=7; z=x+10">$x $y $z</span>
   ... </div>""", x=42)
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>42 7 52</span>
   </div>
 
@@ -257,7 +257,7 @@
   ...   <img alt="${unicode('La Pe\xc3\xb1a', 'utf-8').encode('utf-8')}" />
   ...   <img alt="Hello ${unicode('La Pe\xc3\xb1a', 'utf-8').encode('utf-8')}!" />
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <img alt="La Peña" />
       <img alt="Hello La Peña" />
       <img alt="La Peña, oh La Peña" />
@@ -273,7 +273,7 @@
   ...   <img alt="La Peña" />
   ...   <img alt="${alt}" />
   ... </div>""", alt=unicode("La Pe\xc3\xb1a", 'utf-8'))
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <img alt="La Pe&ntilde;a" />
     <img alt="La Peña" />
   </div>
@@ -283,7 +283,7 @@
   ... <div xmlns="http://www.w3.org/1999/xhtml">
   ...   <strong>"${quote}"</strong>
   ... </div>""", quote="Hello, World!")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <strong>"Hello, World!"</strong>
     </div>
   
@@ -293,7 +293,7 @@
   ... <div xmlns="http://www.w3.org/1999/xhtml">
   ...   ${message}
   ... </div>""", message="Hello, <em>World</em>!")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       Hello, <em>World</em>!
     </div>
 
@@ -320,7 +320,7 @@
   ...   ${message}
   ... /* ]]> */
   ... </div>""", message="Hello, <em>World!")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       /* <![CDATA[ */
       Hello, <em>World!
       /* ]]> */
@@ -338,7 +338,7 @@
   ...  </py:for>
   ...  ];
   ... </script>""")
-  <script type="text/javascript">
+  <script type="text/javascript" xmlns="http://www.w3.org/1999/xhtml">
   var brands = [
   ];
   </script>
@@ -363,7 +363,7 @@
   ... });
   ... </script>
   ... </div>""", brands=brands)
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
   <script type="text/javascript">
     var brands = [
       { value : "1", title : "One" },
@@ -386,7 +386,7 @@
   ...     ${rendermenu([])}
   ...   </ul>
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
   </div>
   
 :: Slightly more complex recursive function calls
@@ -404,7 +404,7 @@
   ...   </ul>
   ...   ${rendermenu(menu)}
   ... </div>""", menu=[dict(title=u"Menu entry", url="/test", current=True)])
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <ul>
       <li class="current">
         <a href="/test">Menu entry</a>

Modified: z3c.pt/trunk/src/z3c/pt/i18n.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/i18n.txt	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/src/z3c/pt/i18n.txt	2008-09-02 16:01:10 UTC (rev 90715)
@@ -49,7 +49,7 @@
 Let's try rendering this template without passing a target language.
     
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>
       Default
     </span>
@@ -58,7 +58,7 @@
 Now we'll render the template again---passing German as the language.
 
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>Mock translation of 'test_msgid'.</span>
   </div>
 
@@ -76,7 +76,7 @@
 
   >>> template = PageTemplate(body)
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>
       Default
     </span>
@@ -85,7 +85,7 @@
 Passing German:
   
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>Mock translation of 'Default'.</span>
   </div>
 
@@ -101,14 +101,14 @@
 
   >>> template = PageTemplate(body)
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <p>
       <span>18</span> bananas.
     </p>
   </div>
     
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <p>Mock translation of '${count} bananas.'.</p>
   </div>
 
@@ -129,7 +129,7 @@
 
   >>> template = PageTemplate(body)
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Simple Title">
       Default
     </span>
@@ -138,7 +138,7 @@
 Passing German:
 
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Mock translation of 'Simple Title'.">
       Default
     </span>
@@ -159,7 +159,7 @@
 
   >>> template = PageTemplate(body)
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Simple Title">
       Default
     </span>
@@ -168,7 +168,7 @@
 Passing German:
 
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Mock translation of 'title_simple'.">
       Default
     </span>
@@ -189,7 +189,7 @@
 
   >>> template = PageTemplate(body)
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Simple Title">
       Default
     </span>
@@ -198,7 +198,7 @@
 Passing German:
 
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Mock translation of 'title_simple'.">
       Default
     </span>
@@ -220,7 +220,7 @@
 
   >>> template = PageTemplate(body)
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Simple Title" longdesc="A not so short description.">
       Default
     </span>
@@ -229,7 +229,7 @@
 Passing German:
 
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Mock translation of 'title_simple'."
           longdesc="Mock translation of 'desc_short'.">
       Default
@@ -259,7 +259,7 @@
 
   >>> template = PageTemplate(body)
   >>> print template.render()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Title">
       Default, "default", 'default'
     </span>
@@ -269,7 +269,7 @@
 Passing German:
 
   >>> print template.render(target_language='de')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span title="Mock translation of 'aid'.">Mock translation of 'tid'.</span>
     <span>Mock translation of 'tid'.</span>
   </div>

Modified: z3c.pt/trunk/src/z3c/pt/template.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/template.txt	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/src/z3c/pt/template.txt	2008-09-02 16:01:10 UTC (rev 90715)
@@ -13,7 +13,7 @@
   ... <div xmlns="http://www.w3.org/1999/xhtml">
   ...   Hello World!
   ... </div>""")()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     Hello World!
   </div>
 
@@ -25,7 +25,7 @@
   >>> path = tests.__path__[0]
   >>> t = PageTemplateFile(path+'/helloworld.pt')
   >>> print t()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     Hello World!
   </div>
 
@@ -47,7 +47,7 @@
   >>> view = ViewPageTemplateView()
     
   >>> print view(test=u'test')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>&lt;ViewPageTemplateView object at ...&gt;</span>
     <span>context</span>
     <span>request</span>
@@ -67,7 +67,7 @@
   >>> view = ViewPageTemplateView()
 
   >>> print view(test=u'test')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <span>&lt;ViewPageTemplateView object at ...&gt;</span>
     <span>context</span>
     <span>request</span>
@@ -125,7 +125,7 @@
   ...   <greeting name="World" />
   ... </div>
   ... """, parser=GenshiParser())()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     Hello World!
   <BLANKLINE>
   </div>
@@ -157,7 +157,7 @@
   ... </div>""")
 
   >>> print template2(template1=template1)
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <div>
       <div>
       Hello, world!
@@ -195,7 +195,7 @@
   ... </div>""")
 
   >>> print content(main=main)
-  <html>
+  <html xmlns="http://www.w3.org/1999/xhtml">
     <div>
          I replace you.
     </div>
@@ -206,7 +206,7 @@
   >>> from z3c.pt.template import BaseTemplateFile
   >>> template = BaseTemplateFile(path+"/xinclude1.pt", mock_parser)
   >>> print template()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <div>
     <span>Hello, world!</span>
     </div>
@@ -219,7 +219,7 @@
 
   >>> template = BaseTemplateFile(path+"/xinclude3.pt", GenshiParser())
   >>> print template()
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
   <BLANKLINE>
   <BLANKLINE>
     <p class="greeting">

Modified: z3c.pt/trunk/src/z3c/pt/tests/test_edgecases.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/tests/test_edgecases.py	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/src/z3c/pt/tests/test_edgecases.py	2008-09-02 16:01:10 UTC (rev 90715)
@@ -27,7 +27,7 @@
         expected = u"""\
         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-        <html>
+        <html xmlns="http://www.w3.org/1999/xhtml">
         foo \xa9
         </html>"""
         t = PageTemplate(body)
@@ -55,7 +55,7 @@
         expected = u"""\
         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-        <html>
+        <html xmlns="http://www.w3.org/1999/xhtml">
         <div id="\xa9"/>
         </html>"""
         t = PageTemplate(body)
@@ -80,7 +80,7 @@
         expected = u"""\
         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-        <html>
+        <html xmlns="http://www.w3.org/1999/xhtml">
         <title>\xa9</title>
         <div label="\xa9" id="\xa9"/>
         </html>"""
@@ -132,7 +132,7 @@
         expected = u"""\
         <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-        <html>
+        <html xmlns="http://www.w3.org/1999/xhtml">
         </html>"""
         t = PageTemplate(body, doctype=doctypes.xhtml_strict)
         self.assertEqual(norm(t.render()), norm(expected))
@@ -152,7 +152,7 @@
         expected = u"""\
         <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-        <html>
+        <html xmlns="http://www.w3.org/1999/xhtml">
         </html>"""
         t = PageTemplate(body, doctype=doctypes.xhtml_strict)
         self.assertEqual(norm(t.render()), norm(expected))
@@ -172,7 +172,7 @@
         expected = u"""\
         <!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML4.01 Transitional//EN"
         "http://www.w3.org/TR/html4/loose.dtd">
-        <html>
+        <html xmlns="http://www.w3.org/1999/xhtml">
         </html>"""
         t = PageTemplate(body, doctype=doctypes.html)
         t.doctype = doctypes.html
@@ -191,7 +191,7 @@
         </html>
         """
         expected = u"""\
-        <html>
+        <html xmlns="http://www.w3.org/1999/xhtml">
         </html>"""
         t = PageTemplate(body, doctype=doctypes.no_doctype)
         self.assertEqual(norm(t.render()), norm(expected))

Modified: z3c.pt/trunk/src/z3c/pt/translation.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/translation.py	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/src/z3c/pt/translation.py	2008-09-02 16:01:10 UTC (rev 90715)
@@ -238,6 +238,9 @@
             _.append(clauses.Assign(self.use_macro, self.symbols.metal))
 
             # compute macro function arguments and create argument string
+            if 'xmlns' in self.element.attrib:
+                kwargs.append(('include_ns_attribute', repr(True)))
+                
             arguments = ", ".join(
                 tuple("%s=%s" % (arg, arg) for arg in \
                       itertools.chain(*self.stream.scope))+
@@ -493,6 +496,11 @@
             self.root = elements[0]
             del self.root.attrib[utils.metal_attr('define-macro')]
 
+        if macro is None or 'include_ns_attribute' in params:
+            # add namespace attribute
+            namespace = self.root.tag.split('}')[0][1:]
+            self.root.attrib['xmlns'] = namespace
+        
         # choose function wrapper; note that if macro is the empty
         # string, we'll still use the macro wrapper
         if macro is not None:

Modified: z3c.pt/trunk/src/z3c/pt/translation.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/translation.txt	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/src/z3c/pt/translation.txt	2008-09-02 16:01:10 UTC (rev 90715)
@@ -14,7 +14,7 @@
   ... <div xmlns="http://www.w3.org/1999/xhtml">
   ...   Hello World!
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       Hello World!
     </div>
 
@@ -38,7 +38,7 @@
   ...   La Peña
   ...   <img alt="La Peña" />
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       La Peña
       <img alt="La Pe&ntilde;a" />
     </div>
@@ -51,7 +51,7 @@
   ...   /* ]]> */
   ...   <span>Not protected</span> <![CDATA[ This is protected ]]>
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       /* <![CDATA[ */
       This is protected
       /* ]]> */
@@ -70,7 +70,7 @@
   ...   Hello &nbsp; World!
   ... </html>""")
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-    <html>
+    <html xmlns="http://www.w3.org/1999/xhtml">
       Hello &nbsp; World!
     </html>
 
@@ -84,7 +84,7 @@
   ...   >&rarr;</a>
   ...   <span class="&rarr;" />
   ... </html>""")
-    <html>
+    <html xmlns="http://www.w3.org/1999/xhtml">
       Hello &nbsp; World!
       <a href="localhost" title="Singing &amp; Dancing">&rarr;</a>
       <span class="&rarr;" />
@@ -97,7 +97,7 @@
   ...   <?xml-stylesheet href="classic.xsl" type="text/xml"?>
   ...   Hello World!
   ... </html>""")
-    <html>
+    <html xmlns="http://www.w3.org/1999/xhtml">
       <?xml-stylesheet href="classic.xsl" type="text/xml"?>
       Hello World!
     </html>
@@ -108,7 +108,7 @@
   ... <html xmlns="http://www.w3.org/1999/xhtml">
   ...   <!-- hello world -->
   ... </html>""")
-    <html>
+    <html xmlns="http://www.w3.org/1999/xhtml">
       <!-- hello world -->
     </html>
   

Modified: z3c.pt/trunk/src/z3c/pt/zpt.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/zpt.txt	2008-09-02 15:49:51 UTC (rev 90714)
+++ z3c.pt/trunk/src/z3c/pt/zpt.txt	2008-09-02 16:01:10 UTC (rev 90715)
@@ -31,7 +31,7 @@
   ...   <span tal:replace="'Hello World!'"><b>Hello Universe!</b></span>
   ...   <span tal:content="None" />
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <span class="defabc" style="hij" onclick="alert();" id="test">abcghi</span>
       Hello World!
       Hello World!
@@ -47,7 +47,7 @@
   ...     <li tal:repeat="i range(5)"><span tal:replace="'Item ' + str(i) + ')'" /></li>
   ...   </ul>
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <ul>
         <li>Item 0)</li>
         <li>Item 1)</li>
@@ -66,7 +66,7 @@
   ...     <li tal:repeat="i range(3)"><span tal:replace="str(i) + ' ' + str(repeat['i'].even())" /></li>
   ...   </ul>
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <ul>
         <li>0 True</li>
         <li>1 False</li>
@@ -86,7 +86,7 @@
   ...     Do not show me!
   ...   </div>
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <div>
         Show me!
       </div>
@@ -102,7 +102,7 @@
   ...        line comment -->
   ...   <!-- a comment with an ${'expression'} -->
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <!-- a comment -->
       <!-- a multi-
            line comment -->
@@ -119,7 +119,7 @@
   ...   <tal:multiple repeat="i range(3)" replace="i" />
   ...   <tal:div condition="True">True</tal:div>
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       Hello World!
       Hello World!
       0
@@ -137,7 +137,7 @@
   ...   <p tal:omit-tag="True">No paragraph here either.</p>
   ...   <p tal:omit-tag="False">A paragraph here.</p>
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       No paragraph here.
       No paragraph here either.
       <p>A paragraph here.</p>
@@ -153,7 +153,7 @@
   ...   <span tal:replace="'%sbr /%s' % (chr(60), chr(62))" />
   ...   <span tal:content="unicode('La Pe\xc3\xb1a', 'utf-8')" />
   ... </div>""")
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <img title="&lt;Hello&gt;" />
       <br />
       &lt;br /&gt;
@@ -172,7 +172,7 @@
   ...   <span tal:replace="path: test2/greeting" />
   ... </div>""", request=object(),
   ... test1={'greeting': u'Hello'}, test2=Test())
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     Hello
     Hello
   </div>
@@ -186,7 +186,7 @@
   ...   <img tal:attributes="alt string:Leonardo da Vinci;; Musee du Louvre, 1503;
   ...                        title string:Mona Lisa" />
   ... </div>""", request=object(), greeting=u'Hello')
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     Hello, world!
     <img alt="Leonardo da Vinci; Musee du Louvre, 1503" title="Mona Lisa" />
   </div>
@@ -200,7 +200,7 @@
   ...     <span tal:replace="test/greeting" />
   ...   </div>
   ... </div>""", request=object(), test={'greeting': u'Hello'})
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <div>
       Hello
     </div>
@@ -226,7 +226,7 @@
   ...       <span tal:replace="int('a')|path: mydict/a" />
   ...   </tal:path-expression-testing>
   ... </div>""")
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
   <BLANKLINE>
         <div>
            1
@@ -250,7 +250,7 @@
   ...         tal:replace="structure nocall: dir" />
   ...   <span tal:replace="structure dir" />
   ... </div>""", request=object())
-    <div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
       <built-in function dir>
       <built-in function dir>
     </div>
@@ -277,7 +277,7 @@
 
   >>> template = MockTemplate(body, ZopePageTemplateParser())
   >>> print render_zpt(body, template=template)
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <div class="greeting">
       Hello, earth!
     </div>
@@ -318,7 +318,7 @@
   
   >>> template = MockTemplate(body, ZopePageTemplateParser())
   >>> print render_zpt(body, template=template)
-  <div>
+  <div xmlns="http://www.w3.org/1999/xhtml">
     <div>
       Hello, <b class="name">stranger!</b>
     </div>



More information about the Checkins mailing list