You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/12/30 03:55:02 UTC

svn commit: r607501 [2/2] - in /tapestry/tapestry5/trunk: tapestry-core/src/main/java/org/apache/tapestry/ tapestry-core/src/main/java/org/apache/tapestry/annotations/ tapestry-core/src/main/java/org/apache/tapestry/corelib/mixins/ tapestry-core/src/ma...

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml Sat Dec 29 18:54:55 2007
@@ -3,297 +3,288 @@
 
     <h1>Tapestry 5 Integration Application 1</h1>
 
-    <table>
-        <tr>
-            <td>
-                <ul>
-                    <li>
-                        <a t:type="PageLink" page="MerryChristmas">Count Page</a>
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="InjectDemo">Inject Demo</a>
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="Countdown">Countdown Page</a>
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="ParameterConflict">
-                            Template Overridden by Class Page
-                        </a>
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="EnvironmentalDemo">
-                            Environmental Annotation Usage
-                        </a>
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="expansion">Expansion Page</a>
-                    </li>
-                    <li>
-                        <a href="BadTemplate">BadTemplate Page</a>
-                        -- More exception reporting
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="ActionPage">Action Page</a>
-                        -- tests fixture for ActionLink component
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="InstanceMixin">InstanceMixin</a>
-                        -- Mixin added to particular component instance
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="RenderPhaseOrder">
-                            RenderPhaseOrder
-                        </a>
-                        -- Order of operations when invoking render phase methods
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="SimpleForm">SimpleForm</a>
-                        -- first pass at writing Form and TextField components
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="NumberSelect">NumberSelect</a>
-                        -- passivate/activate page context demo
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="Localization">Localization</a>
-                        -- accessing localized messages from the component catalog
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="nested/AssetDemo">AssetDemo</a>
-                        -- declaring an using Assets
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="ExpansionSubclass">
-                            ExpansionSubclass
-                        </a>
-                        -- components can inherit templates from base classes
-                    </li>
-                    <li>
-                        <a href="InjectContainerMismatch">
-                            InjectContainerMismatch
-                        </a>
-                        -- check error reporting when @InjectContainer doesn't match
-                        the actual field type
-                    </li>
 
-                    <li>
-                        <a t:type="PageLink" page="ParameterDefault">
-                            ParameterDefault
-                        </a>
-                        -- defaulter methods for component parameters
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="ValidForm">ValidForm</a>
-                        -- server-side input validation
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="PasswordFieldDemo">
-                            PasswordFieldDemo
-                        </a>
-                        -- test for the PasswordField component
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="RenderComponentDemo">
-                            RenderComponentDemo
-                        </a>
-                        -- components that "nominate" other components to render
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="BlockDemo">BlockDemo</a>
-                        -- use of blocks to control rendering
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="ToDoListVolatile">
-                            ToDo List (Volatile)
-                        </a>
-                        -- Loops and Submit inside Form, volatile mode
-                    </li>
-                    <li>
-                        <t:pagelink page="MissingTemplate">
-                            Missing Template Demo
-                        </t:pagelink>
-                        -- Demo for what happens when a template is not found for a
-                        page
-                    </li>
+    <ul>
+        <li>
+            <a t:type="PageLink" page="MerryChristmas">Count Page</a>
+        </li>
+        <li>
+            <a t:type="PageLink" page="InjectDemo">Inject Demo</a>
+        </li>
+        <li>
+            <a t:type="PageLink" page="Countdown">Countdown Page</a>
+        </li>
+        <li>
+            <a t:type="PageLink" page="ParameterConflict">
+                Template Overridden by Class Page
+            </a>
+        </li>
+        <li>
+            <a t:type="PageLink" page="EnvironmentalDemo">
+                Environmental Annotation Usage
+            </a>
+        </li>
+        <li>
+            <a t:type="PageLink" page="expansion">Expansion Page</a>
+        </li>
+        <li>
+            <a href="BadTemplate">BadTemplate Page</a>
+            -- More exception reporting
+        </li>
+        <li>
+            <a t:type="PageLink" page="ActionPage">Action Page</a>
+            -- tests fixture for ActionLink component
+        </li>
+        <li>
+            <a t:type="PageLink" page="InstanceMixin">InstanceMixin</a>
+            -- Mixin added to particular component instance
+        </li>
+        <li>
+            <a t:type="PageLink" page="RenderPhaseOrder">
+                RenderPhaseOrder
+            </a>
+            -- Order of operations when invoking render phase methods
+        </li>
+        <li>
+            <a t:type="PageLink" page="SimpleForm">SimpleForm</a>
+            -- first pass at writing Form and TextField components
+        </li>
+        <li>
+            <a t:type="PageLink" page="NumberSelect">NumberSelect</a>
+            -- passivate/activate page context demo
+        </li>
+        <li>
+            <a t:type="PageLink" page="Localization">Localization</a>
+            -- accessing localized messages from the component catalog
+        </li>
+        <li>
+            <a t:type="PageLink" page="nested/AssetDemo">AssetDemo</a>
+            -- declaring an using Assets
+        </li>
+        <li>
+            <a t:type="PageLink" page="ExpansionSubclass">
+                ExpansionSubclass
+            </a>
+            -- components can inherit templates from base classes
+        </li>
+        <li>
+            <a href="InjectContainerMismatch">
+                InjectContainerMismatch
+            </a>
+            -- check error reporting when @InjectContainer doesn't match
+            the actual field type
+        </li>
 
-                    <li>
-                        <t:pagelink page="zonedemo">Zone Demo</t:pagelink>
-                        -- dynamic updates within a page
-                    </li>
-                </ul>
-            </td>
-            <td>
-                <ul>
+        <li>
+            <a t:type="PageLink" page="ParameterDefault">
+                ParameterDefault
+            </a>
+            -- defaulter methods for component parameters
+        </li>
+        <li>
+            <a t:type="PageLink" page="ValidForm">ValidForm</a>
+            -- server-side input validation
+        </li>
+        <li>
+            <a t:type="PageLink" page="PasswordFieldDemo">
+                PasswordFieldDemo
+            </a>
+            -- test for the PasswordField component
+        </li>
+        <li>
+            <a t:type="PageLink" page="RenderComponentDemo">
+                RenderComponentDemo
+            </a>
+            -- components that "nominate" other components to render
+        </li>
+        <li>
+            <a t:type="PageLink" page="BlockDemo">BlockDemo</a>
+            -- use of blocks to control rendering
+        </li>
+        <li>
+            <a t:type="PageLink" page="ToDoListVolatile">
+                ToDo List (Volatile)
+            </a>
+            -- Loops and Submit inside Form, volatile mode
+        </li>
+        <li>
+            <t:pagelink page="MissingTemplate">
+                Missing Template Demo
+            </t:pagelink>
+            -- Demo for what happens when a template is not found for a
+            page
+        </li>
 
-                    <li>
-                        <a t:type="PageLink" page="ToDoList">ToDo List</a>
-                        -- Loops and Submit inside Form using a primary key encoder
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="FlashDemo">FlashDemo</a>
-                        -- demonstrate "flash" persistence
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="beaneditordemo">
-                            BeanEditor Demo
-                        </a>
-                        -- demonstrate the BeanEditor mega-component
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="pageloadeddemo">
-                            PageLoaded Demo
-                        </a>
-                        -- shows that page lifecycle methods are invoked
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="griddemo">Grid Demo</a>
-                        -- default Grid component
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="nullgrid">Null Grid</a>
-                        -- handling of null source for Grid
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="gridsetdemo">Grid Set Demo</a>
-                        -- handling of Set sources for Grid
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="gridenumdemo">Grid Enum Demo</a>
-                        -- handling of enum types in the Grid
-                    </li>
-                    <li>
-                        <t:pageLink page="GridRemoveReorderDemo">
-                            Grid Remove/Reorder Demo
-                        </t:pageLink>
-                        -- handling of remove and reorder parameters
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="protected">Protected Page</a>
-                        -- Demonstrate result of non-void return from a page's
-                        activate method.
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="kicker">Kicker</a>
-                        -- demos complex page and component context in links
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="simpletrackgriddemo">
-                            SimpleTrack Grid Demo
-                        </a>
-                        -- customizing the model for a Grid around an interface
-                    </li>
-                    <li>
-                        <a t:type="PageLink" page="pagelinkcontext">
-                            PageLink Context Demo
-                        </a>
-                        -- passing explicit context in a page render link
-                    </li>
-                    <li>
-                        <a t:type="pagelink" page="ValidBeanEditorDemo">
-                            Client Validation Demo
-                        </a>
-                        --BeanEditor with validation enabled
-                    </li>
-                    <li>
-                        <a href="recursivedemo">Recursive Demo</a>
-                        -- check for handling of recursive components
-                    </li>
-                    <li>
-                        <t:pagelink page="renderabledemo">
-                            Renderable Demo
-                        </t:pagelink>
-                        -- Shows that render phase methods can return a Renderable
-                        object
-                    </li>
-                    <li>
-                        <t:pagelink page="eventhandlerdemo" context="'clear'">
-                            EventHandler Demo
-                        </t:pagelink>
-                        -- Tests for event handling method order and matching
-                    </li>
-                    <li>
-                        <t:pagelink page="inheritedbindingsdemo">
-                            Inherited Bindings Demo
-                        </t:pagelink>
-                        -- Tests for components that inherit bindings from
-                        containing components
-                    </li>
-                    <li>
-                        <t:pagelink page="ClientPersistenceDemo">
-                            Client Persistence Demo
-                        </t:pagelink>
-                        -- component field values persisted on the client side
-                    </li>
-                    <li>
-                        <t:pagelink page="attributeExpansionsDemo">
-                            Attribute Expansions Demo
-                        </t:pagelink>
-                        -- use expansions inside attributes of ordinary elements
-                    </li>
-                    <li>
-                        <t:pagelink page="PaletteDemo">Palette Demo</t:pagelink>
-                        -- multiple selection component
-                    </li>
-                    <li>
-                        <t:pagelink page="ReturnTypes">Return Types</t:pagelink>
-                        -- Tests various event handler return types
-                    </li>
-                    <li>
-                        <t:pagelink page="FormEncodingType">
-                            Form Encoding Type
-                        </t:pagelink>
-                        -- Test ability to set an encoding type for a Form
-                    </li>
-                    <li>
-                        <t:pagelink page="RadioDemo">RadioDemo</t:pagelink>
-                        -- Use of the RadioGroup and Radio components.
-                    </li>
-                    <li>
-                        <t:pagelink page="RegexpDemo">Regexp Demo</t:pagelink>
-                        -- Use of the Regexp validator
-                    </li>
-                    <li>
-                        <t:pagelink page="BeanEditRemoveReorder">
-                            BeanEdit Remove/Reorder
-                        </t:pagelink>
-                        -- Use of the remove and reorder parameters with
-                        BeanEditForm
-                    </li>
-                    <li>
-                        <t:pagelink page="MultiBeanEditDemo">
-                            MultiBeanEdit Demo
-                        </t:pagelink>
-                        -- Multiple BeanEditor components in a single form
-                    </li>
-                    <li>
-                        <t:pagelink page="GridFormDemo">Grid Form Demo</t:pagelink>
-                        -- Grid operating inside a Form
-                    </li>
-                    <li>
-                        <t:pagelink page="DateFieldDemo">DateField Demo</t:pagelink>
-                        -- using DateField by itself on a page
-                    </li>
-                    <li>
-                        <t:pagelink page="BeanEditDateDemo">
-                            BeanEditor / Date Demo
-                        </t:pagelink>
-                        -- Use of date properties inside BeanEditor and BeanDisplay
-                    </li>
+        <li>
+            <t:pagelink page="zonedemo">Zone Demo</t:pagelink>
+            -- dynamic updates within a page
+        </li>
 
-                    <li>
-                        <t:pagelink page="eventmethodtranslate">EventMethod Translator</t:pagelink>
-                        -- Demo ability to provide toclient and parseclient event handler methods
-                    </li>
+        <li>
+            <a t:type="PageLink" page="ToDoList">ToDo List</a>
+            -- Loops and Submit inside Form using a primary key encoder
+        </li>
+        <li>
+            <a t:type="PageLink" page="FlashDemo">FlashDemo</a>
+            -- demonstrate "flash" persistence
+        </li>
+        <li>
+            <a t:type="PageLink" page="beaneditordemo">
+                BeanEditor Demo
+            </a>
+            -- demonstrate the BeanEditor mega-component
+        </li>
+        <li>
+            <a t:type="PageLink" page="pageloadeddemo">
+                PageLoaded Demo
+            </a>
+            -- shows that page lifecycle methods are invoked
+        </li>
+        <li>
+            <a t:type="PageLink" page="griddemo">Grid Demo</a>
+            -- default Grid component
+        </li>
+        <li>
+            <a t:type="PageLink" page="nullgrid">Null Grid</a>
+            -- handling of null source for Grid
+        </li>
+        <li>
+            <a t:type="PageLink" page="gridsetdemo">Grid Set Demo</a>
+            -- handling of Set sources for Grid
+        </li>
+        <li>
+            <a t:type="PageLink" page="gridenumdemo">Grid Enum Demo</a>
+            -- handling of enum types in the Grid
+        </li>
+        <li>
+            <t:pageLink page="GridRemoveReorderDemo">
+                Grid Remove/Reorder Demo
+            </t:pageLink>
+            -- handling of remove and reorder parameters
+        </li>
+        <li>
+            <a t:type="PageLink" page="protected">Protected Page</a>
+            -- Demonstrate result of non-void return from a page's
+            activate method.
+        </li>
+        <li>
+            <a t:type="PageLink" page="kicker">Kicker</a>
+            -- demos complex page and component context in links
+        </li>
+        <li>
+            <a t:type="PageLink" page="simpletrackgriddemo">
+                SimpleTrack Grid Demo
+            </a>
+            -- customizing the model for a Grid around an interface
+        </li>
+        <li>
+            <a t:type="PageLink" page="pagelinkcontext">
+                PageLink Context Demo
+            </a>
+            -- passing explicit context in a page render link
+        </li>
+        <li>
+            <a t:type="pagelink" page="ValidBeanEditorDemo">
+                Client Validation Demo
+            </a>
+            --BeanEditor with validation enabled
+        </li>
+        <li>
+            <a href="recursivedemo">Recursive Demo</a>
+            -- check for handling of recursive components
+        </li>
+        <li>
+            <t:pagelink page="renderabledemo">
+                Renderable Demo
+            </t:pagelink>
+            -- Shows that render phase methods can return a Renderable
+            object
+        </li>
+        <li>
+            <t:pagelink page="eventhandlerdemo" context="'clear'">
+                EventHandler Demo
+            </t:pagelink>
+            -- Tests for event handling method order and matching
+        </li>
+        <li>
+            <t:pagelink page="inheritedbindingsdemo">
+                Inherited Bindings Demo
+            </t:pagelink>
+            -- Tests for components that inherit bindings from
+            containing components
+        </li>
+        <li>
+            <t:pagelink page="ClientPersistenceDemo">
+                Client Persistence Demo
+            </t:pagelink>
+            -- component field values persisted on the client side
+        </li>
+        <li>
+            <t:pagelink page="attributeExpansionsDemo">
+                Attribute Expansions Demo
+            </t:pagelink>
+            -- use expansions inside attributes of ordinary elements
+        </li>
+        <li>
+            <t:pagelink page="PaletteDemo">Palette Demo</t:pagelink>
+            -- multiple selection component
+        </li>
+        <li>
+            <t:pagelink page="ReturnTypes">Return Types</t:pagelink>
+            -- Tests various event handler return types
+        </li>
+        <li>
+            <t:pagelink page="FormEncodingType">
+                Form Encoding Type
+            </t:pagelink>
+            -- Test ability to set an encoding type for a Form
+        </li>
+        <li>
+            <t:pagelink page="RadioDemo">RadioDemo</t:pagelink>
+            -- Use of the RadioGroup and Radio components.
+        </li>
+        <li>
+            <t:pagelink page="RegexpDemo">Regexp Demo</t:pagelink>
+            -- Use of the Regexp validator
+        </li>
+        <li>
+            <t:pagelink page="BeanEditRemoveReorder">
+                BeanEdit Remove/Reorder
+            </t:pagelink>
+            -- Use of the remove and reorder parameters with
+            BeanEditForm
+        </li>
+        <li>
+            <t:pagelink page="MultiBeanEditDemo">
+                MultiBeanEdit Demo
+            </t:pagelink>
+            -- Multiple BeanEditor components in a single form
+        </li>
+        <li>
+            <t:pagelink page="GridFormDemo">Grid Form Demo</t:pagelink>
+            -- Grid operating inside a Form
+        </li>
+        <li>
+            <t:pagelink page="DateFieldDemo">DateField Demo</t:pagelink>
+            -- using DateField by itself on a page
+        </li>
+        <li>
+            <t:pagelink page="BeanEditDateDemo">
+                BeanEditor / Date Demo
+            </t:pagelink>
+            -- Use of date properties inside BeanEditor and BeanDisplay
+        </li>
 
-                    <li>
-                        <t:pagelink page="autocompletedemo">Autocomplete Mixin Demo</t:pagelink>
-                        -- Demo the autocomplete mixin for text fields.
-                    </li>
+        <li>
+            <t:pagelink page="eventmethodtranslate">EventMethod Translator</t:pagelink>
+            -- Demo ability to provide toclient and parseclient event handler methods
+        </li>
 
-                </ul>
-            </td>
-        </tr>
-    </table>
+        <li>
+            <t:pagelink page="autocompletedemo">Autocomplete Mixin Demo</t:pagelink>
+            -- Demo the autocomplete mixin for text fields.
+        </li>
+
+    </ul>
 
 </html>

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/XMLContent.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/XMLContent.tml?rev=607501&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/XMLContent.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/XMLContent.tml Sat Dec 29 18:54:55 2007
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+    <h1>XML Content</h1>
+
+    <p>
+        <![CDATA[< & >]]>
+    </p>
+
+</html>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/dom/DOMTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/dom/DOMTest.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/dom/DOMTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/dom/DOMTest.java Sat Dec 29 18:54:55 2007
@@ -40,7 +40,59 @@
 
         d.newRootElement("empty");
 
-        assertEquals(d.toString(), "<empty/>");
+        assertEquals(d.toString(), "<?xml version=\"1.0\"?>\n<empty/>");
+    }
+
+    @Test
+    public void namespaced_elements() throws Exception
+    {
+        Document d = new Document(new XMLMarkupModel());
+
+        Element root = d.newRootElement("fredns", "root");
+
+        root.defineNamespace("fredns", "f");
+        root.defineNamespace("barneyns", "b");
+
+        Element nested = root.elementNS("fredns", "nested");
+
+        Element deepest = nested.elementNS("barneyns", "deepest");
+
+        assertEquals(d.toString(), readFile("namespaced_elements.txt"));
+    }
+
+    @Test
+    public void namespace_element_without_a_prefix()
+    {
+
+        Document d = new Document(new XMLMarkupModel());
+
+        Element root = d.newRootElement("fredns", "root");
+
+        try
+        {
+            d.toString();
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "Namespace prefix for URI 'fredns' is not defined.");
+        }
+    }
+
+    @Test
+    public void default_namespace()
+    {
+        Document d = new Document(new XMLMarkupModel());
+
+        String namespaceURI = "http://foo.com";
+
+        Element root = d.newRootElement(namespaceURI, "root");
+
+        root.defineNamespace(namespaceURI, "");
+        root.attribute(namespaceURI, "gnip", "gnop");
+
+
+        assertEquals(d.toString(), "<?xml version=\"1.0\"?>\n<root gnip=\"gnop\" xmlns=\"http://foo.com\"/>");
     }
 
     /**
@@ -56,7 +108,7 @@
         e.attribute("fred", "flintstone");
         e.attribute("barney", "rubble");
 
-        assertEquals(d.toString(), readFile("document_with_root_element_and_attributes.txt", true));
+        assertEquals(d.toString(), readFile("document_with_root_element_and_attributes.txt"));
     }
 
     @Test
@@ -78,7 +130,7 @@
 
         assertSame(p.getParent(), e);
 
-        assertEquals(d.toString(), readFile("nested_elements.txt", true));
+        assertEquals(d.toString(), readFile("nested_elements.txt"));
     }
 
     @Test
@@ -288,7 +340,8 @@
         root.elementAt(1, "one").element("tiny");
         root.elementAt(2, "two").element("bubbles");
 
-        assertEquals(d.toString(), "<fred><start/><one><tiny/></one><two><bubbles/></two><end/></fred>");
+        assertEquals(d.toString(),
+                     "<?xml version=\"1.0\"?>\n<fred><start/><one><tiny/></one><two><bubbles/></two><end/></fred>");
     }
 
     @Test
@@ -333,7 +386,7 @@
         Element root = d.newRootElement("prime");
         root.element("slag");
         d.dtd("prime", "-//TF", "tf");
-        String expected = "<!DOCTYPE prime PUBLIC \"-//TF\" \"tf\"><prime><slag/></prime>";
+        String expected = "<?xml version=\"1.0\"?>\n<!DOCTYPE prime PUBLIC \"-//TF\" \"tf\"><prime><slag/></prime>";
         assertEquals(d.toString(), expected);
     }
 
@@ -343,12 +396,12 @@
         Document d = new Document(new XMLMarkupModel());
         d.newRootElement("prime");
         d.dtd("prime", null, null);
-        assertEquals(d.toString(), "<prime/>");
+        assertEquals(d.toString(), "<?xml version=\"1.0\"?>\n<prime/>");
         d.dtd("prime", "-//TF", null);
-        assertEquals(d.toString(), "<!DOCTYPE prime PUBLIC \"-//TF\"><prime/>");
+        assertEquals(d.toString(), "<?xml version=\"1.0\"?>\n<!DOCTYPE prime PUBLIC \"-//TF\"><prime/>");
 
         d.dtd("prime", null, "tf");
-        assertEquals(d.toString(), "<!DOCTYPE prime SYSTEM \"tf\"><prime/>");
+        assertEquals(d.toString(), "<?xml version=\"1.0\"?>\n<!DOCTYPE prime SYSTEM \"tf\"><prime/>");
     }
 
     @Test
@@ -378,5 +431,38 @@
         assertSame(root.addClassName("barney", "wilma"), root);
 
         assertEquals(root.toString(), "<div class=\"fred barney wilma\"/>");
+    }
+
+    @Test
+    public void cdata_in_HTML_document()
+    {
+        Document d = new Document();
+
+        d.newRootElement("root").cdata("This & That");
+
+        // The '&' is expanded to an entity:
+
+        assertEquals(d.toString(), "<root>This &amp; That</root>");
+    }
+
+    @Test
+    public void cdata_in_XML_document()
+    {
+        Document d = new Document(new XMLMarkupModel());
+
+        d.newRootElement("root").cdata("This & That");
+
+        // The '&' is expanded to an entity:
+
+        assertEquals(d.toString(), "<?xml version=\"1.0\"?>\n<root><![CDATA[This & That]]></root>");
+    }
+
+    @Test
+    public void encoding_specified()
+    {
+        Document d = new Document(new XMLMarkupModel(), "utf-8");
+        d.newRootElement("root");
+
+        assertEquals(d.toString(), "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root/>");
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Sat Dec 29 18:54:55 2007
@@ -1207,11 +1207,22 @@
     /**
      * Tests TAPESTRY-1934.
      */
+    @Test
     public void base_class_must_be_in_controlled_package() throws Exception
     {
         open(BASE_URL + "invalidsuperclass");
 
         assertTextPresent(
                 "Base class org.apache.tapestry.integration.app1.WrongPackageForBaseClass (super class of org.apache.tapestry.integration.app1.pages.InvalidSuperClass) is not in a controlled package and is therefore not valid. You should try moving the class to package org.apache.tapestry.integration.app1.base.");
+    }
+
+    @Test
+    public void xml_content() throws Exception
+    {
+        open(BASE_URL + "xmlcontent");
+
+        // Commented out ... Selenium can't seem to handle an XML response.
+
+        // assertSourcePresent("<![CDATA[< & >]]>");
     }
 }

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/XMLContent.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/XMLContent.java?rev=607501&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/XMLContent.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/XMLContent.java Sat Dec 29 18:54:55 2007
@@ -0,0 +1,22 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app1.pages;
+
+import org.apache.tapestry.annotations.Meta;
+
+@Meta("tapestry.response-content-type=text/xml")
+public class XMLContent
+{
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/DefaultValidationDecoratorTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/DefaultValidationDecoratorTest.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/DefaultValidationDecoratorTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/DefaultValidationDecoratorTest.java Sat Dec 29 18:54:55 2007
@@ -60,7 +60,7 @@
 
         decorator.insideLabel(field, e);
 
-        assertEquals(writer.toString(), "<label accesskey=\"f\" class=\"t-error\"/>");
+        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n<label accesskey=\"f\" class=\"t-error\"/>");
 
         verify();
     }
@@ -84,7 +84,7 @@
 
         decorator.insideLabel(field, e);
 
-        assertEquals(writer.toString(), "<label accesskey=\"f\" class=\"foo t-error\"/>");
+        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n<label accesskey=\"f\" class=\"foo t-error\"/>");
 
         verify();
     }
@@ -109,7 +109,7 @@
         decorator.insideField(field);
 
         assertEquals(writer.toString(),
-                     "<input class=\"foo t-error\" name=\"ex\" size=\"30\" type=\"text\" value=\"freddy\"/>");
+                     "<?xml version=\"1.0\"?>\n<input class=\"foo t-error\" name=\"ex\" size=\"30\" type=\"text\" value=\"freddy\"/>");
 
         verify();
     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImplTest.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImplTest.java Sat Dec 29 18:54:55 2007
@@ -23,7 +23,7 @@
 {
     private void check(Document document, String file) throws Exception
     {
-        assertEquals(document.toString(), readFile(file, true));
+        assertEquals(document.toString(), readFile(file));
     }
 
     @Test
@@ -48,8 +48,7 @@
     {
         Document document = new Document(new XMLMarkupModel());
 
-        document.newRootElement("html").element("body").element("p").text(
-                "Ready to be updated with scripts.");
+        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts.");
 
         DocumentHeadBuilder builder = new DocumentHeadBuilderImpl();
 
@@ -66,8 +65,7 @@
     {
         Document document = new Document(new XMLMarkupModel());
 
-        document.newRootElement("html").element("body").element("p").text(
-                "Ready to be updated with styles.");
+        document.newRootElement("html").element("body").element("p").text("Ready to be updated with styles.");
 
         DocumentHeadBuilder builder = new DocumentHeadBuilderImpl();
 
@@ -84,8 +82,7 @@
     {
         Document document = new Document(new XMLMarkupModel());
 
-        document.newRootElement("html").element("body").element("p").text(
-                "Ready to be updated with styles.");
+        document.newRootElement("html").element("body").element("p").text("Ready to be updated with styles.");
 
         DocumentHeadBuilder builder = new DocumentHeadBuilderImpl();
 
@@ -122,8 +119,7 @@
     {
         Document document = new Document();
 
-        document.newRootElement("html").element("body").element("p").text(
-                "Ready to be updated with scripts.");
+        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts.");
 
         DocumentHeadBuilder builder = new DocumentHeadBuilderImpl();
 
@@ -144,8 +140,7 @@
     {
         Document document = new Document();
 
-        document.newRootElement("html").element("body").element("p").text(
-                "Ready to be updated with scripts.");
+        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts.");
 
         DocumentHeadBuilder builder = new DocumentHeadBuilderImpl();
 
@@ -154,7 +149,7 @@
 
         builder.updateDocument(document);
 
-        assertEquals(document.toString(), readFile("add_script.txt", false).trim());
+        assertEquals(document.toString(), readFile("add_script.txt").trim());
     }
 
     /**
@@ -165,8 +160,7 @@
     {
         Document document = new Document(new XMLMarkupModel());
 
-        document.newRootElement("html").element("notbody").element("p").text(
-                "Ready to be updated with scripts.");
+        document.newRootElement("html").element("notbody").element("p").text("Ready to be updated with scripts.");
 
         DocumentHeadBuilder builder = new DocumentHeadBuilderImpl();
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/MarkupWriterImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/MarkupWriterImplTest.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/MarkupWriterImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/MarkupWriterImplTest.java Sat Dec 29 18:54:55 2007
@@ -40,7 +40,7 @@
         w.element("root");
         w.end();
 
-        assertEquals(w.toString(), "<root/>");
+        assertEquals(w.toString(), "<?xml version=\"1.0\"?>\n<root/>");
     }
 
     @Test
@@ -53,7 +53,7 @@
 
         w.write("  ");
 
-        assertEquals(w.toString(), "<root/>");
+        assertEquals(w.toString(), "<?xml version=\"1.0\"?>\n<root/>");
     }
 
     @Test(expectedExceptions = IllegalStateException.class)
@@ -65,6 +65,22 @@
     }
 
     @Test(expectedExceptions = IllegalStateException.class)
+    public void attribute_ns_with_no_current_element()
+    {
+        MarkupWriter w = new MarkupWriterImpl();
+
+        w.attributeNS("foo", "bar", "baz");
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void define_namespace_with_no_current_element()
+    {
+        MarkupWriter w = new MarkupWriterImpl();
+
+        w.defineNamespace("foo", "bar");
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
     public void end_with_no_current_element()
     {
         MarkupWriter w = new MarkupWriterImpl();
@@ -202,5 +218,43 @@
         w.end();
 
         assertEquals(w.toString(), "<root>&lt;&nbsp;&gt;</root>");
+    }
+
+    @Test
+    public void namespaced_elements_and_attributes()
+    {
+        MarkupWriter w = new MarkupWriterImpl(new XMLMarkupModel());
+
+        Element root = w.elementNS("fredns", "root");
+
+        assertSame(root.defineNamespace("fredns", "fred"), root);
+
+        root.defineNamespace("barneyns", "barney");
+
+        assertSame(w.attributeNS("fredns", "foo", "bar"), root);
+
+        Element child = w.elementNS("barneyns", "child");
+
+        assertSame(child.getParent(), root);
+
+        w.end(); // child
+        w.end(); // root
+
+        assertEquals(w.toString(),
+                     "<?xml version=\"1.0\"?>\n<fred:root fred:foo=\"bar\" xmlns:barney=\"barneyns\" xmlns:fred=\"fredns\"><barney:child/></fred:root>");
+    }
+
+    @Test
+    public void cdata_content()
+    {
+        MarkupWriter w = new MarkupWriterImpl(new XMLMarkupModel());
+
+        w.element("root");
+        w.write("Normal Text ");
+        w.cdata("< & >");
+        w.write("More Normal Text");
+
+        assertEquals(w.toString(),
+                     "<?xml version=\"1.0\"?>\n<root>Normal Text <![CDATA[< & >]]>More Normal Text</root>");
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageElementFactoryImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageElementFactoryImplTest.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageElementFactoryImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageElementFactoryImplTest.java Sat Dec 29 18:54:55 2007
@@ -49,16 +49,19 @@
         replay();
 
         PageElementFactory factory = new PageElementFactoryImpl(source, resolver, null, null, null);
-        StartElementToken token = new StartElementToken("fred", l);
+        StartElementToken token = new StartElementToken("http://foo.com", "fred", l);
 
         PageElement element = factory.newStartElement(token);
 
         element.render(writer, queue);
 
+
+        writer.defineNamespace("http://foo.com", "");
+
         verify();
 
-        assertEquals(element.toString(), "Start[fred]");
-        assertEquals(writer.toString(), "<fred></fred>");
+        assertEquals(element.toString(), "Start[http://foo.com fred]");
+        assertEquals(writer.toString(), "<fred xmlns=\"http://foo.com\"></fred>");
     }
 
     @Test
@@ -73,7 +76,7 @@
         replay();
 
         PageElementFactory factory = new PageElementFactoryImpl(source, resolver, null, null, null);
-        AttributeToken token = new AttributeToken("name", "value", l);
+        AttributeToken token = new AttributeToken(null, "name", "value", l);
 
         PageElement element = factory.newAttributeElement(null, token);
 
@@ -83,7 +86,7 @@
 
         verify();
 
-        assertEquals(writer.toString(), "<root name=\"value\"/>");
+        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n<root name=\"value\"/>");
     }
 
     @Test
@@ -111,7 +114,7 @@
         verify();
 
         assertEquals(element.toString(), "End");
-        assertEquals(writer.toString(), "<root>before<nested/>after</root>");
+        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n<root>before<nested/>after</root>");
     }
 
     @Test
@@ -190,7 +193,7 @@
         ComponentResources resources = mockComponentResources();
         Location location = mockLocation();
 
-        AttributeToken token = new AttributeToken("fred", "${flintstone", location);
+        AttributeToken token = new AttributeToken(null, "fred", "${flintstone", location);
 
         replay();
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java Sat Dec 29 18:54:55 2007
@@ -82,7 +82,7 @@
     }
 
     @Test
-    synchronized public void just_HTML()
+    public void just_HTML()
     {
         Resource resource = getResource("justHTML.tml");
 
@@ -101,6 +101,7 @@
         // Spot check a few things ...
 
         assertEquals(t0.getName(), "html");
+        assertEquals(t0.getNamespaceURI(), "");
         checkLine(t0, 1);
 
         TextToken t1 = get(tokens, 1);
@@ -123,6 +124,7 @@
         AttributeToken t13 = get(tokens, 13);
         assertEquals(t13.getName(), "class");
         assertEquals(t13.getValue(), "important");
+        assertEquals(t13.getNamespaceURI(), "");
 
         TextToken t14 = get(tokens, 14);
         // Simplify the text, converting consecutive whitespace to just a single space.
@@ -133,6 +135,47 @@
     }
 
     @Test
+    public void namespaced_element()
+    {
+        Resource resource = getResource("namespaced_element.tml");
+
+        ComponentTemplate template = getParser().parseTemplate(resource);
+
+        assertSame(template.getResource(), resource);
+
+        List<TemplateToken> tokens = template.getTokens();
+
+        // They add up quick ...
+
+        assertEquals(tokens.size(), 6);
+
+        StartElementToken t0 = get(tokens, 0);
+
+        String expectedURI = "http://foo.com";
+
+        assertEquals(t0.getNamespaceURI(), expectedURI);
+        assertEquals(t0.getName(), "bar");
+
+        DefineNamespacePrefixToken t1 = get(tokens, 1);
+
+        assertEquals(t1.getNamespacePrefix(), "foo");
+        assertEquals(t1.getNamespaceURI(), expectedURI);
+
+        AttributeToken t2 = get(tokens, 2);
+
+        assertEquals(t2.getName(), "biff");
+        assertEquals(t2.getValue(), "baz");
+        assertEquals(t2.getNamespaceURI(), expectedURI);
+
+        StartElementToken t3 = get(tokens, 3);
+
+        assertEquals(t3.getNamespaceURI(), "");
+        assertEquals(t3.getName(), "gnip");
+
+        // The rest are close tokens
+    }
+
+    @Test
     public void container_element()
     {
         List<TemplateToken> tokens = tokens("container_element.tml");
@@ -171,17 +214,33 @@
         assertEquals(t.getText().trim(), "lt:< gt:> amp:&");
     }
 
-    /**
-     * Test disabled when not online.
-     */
-    @Test(enabled = true)
+    @Test
     public void html_entity()
     {
+        String expectedURI = "http://www.w3.org/1999/xhtml";
+
         List<TemplateToken> tokens = tokens("html_entity.tml");
 
-        assertEquals(tokens.size(), 4);
+        assertEquals(tokens.size(), 5);
+
+        DTDToken t0 = get(tokens, 0);
+
+        assertEquals(t0.getName(), "html");
+        assertEquals(t0.getPublicId(), "-//W3C//DTD XHTML 1.0 Transitional//EN");
+        assertEquals(t0.getSystemId(), "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd");
+
+        StartElementToken t1 = get(tokens, 1);
+
+        assertEquals(t1.getNamespaceURI(), expectedURI);
+        assertEquals(t1.getName(), "html");
 
-        TextToken t = get(tokens, 2);
+        DefineNamespacePrefixToken t2 = get(tokens, 2);
+
+        assertEquals(t2.getNamespaceURI(), expectedURI);
+        assertEquals(t2.getNamespacePrefix(), "");
+
+
+        TextToken t = get(tokens, 3);
 
         // HTML entities are parsed into values that will ultimately
         // be output as numeric entities. This is less than ideal; would like
@@ -204,7 +263,7 @@
 
         CDATAToken t = get(tokens, 2);
 
-        assertEquals(t.getText(), "CDATA: &lt;foo&gt; &amp; &lt;bar&gt; and <baz>");
+        assertEquals(t.getContent(), "CDATA: &lt;foo&gt; &amp; &lt;bar&gt; and <baz>");
         checkLine(t, 2);
     }
 
@@ -487,7 +546,7 @@
 
         CDATAToken t2 = get(tokens, 2);
 
-        assertEquals(t2.getText(), "${not-an-expansion}");
+        assertEquals(t2.getContent(), "${not-an-expansion}");
     }
 
     @Test
@@ -600,37 +659,36 @@
     public void doctype_parsed_correctly(String fileName) throws Exception
     {
         List<TemplateToken> tokens = tokens(fileName);
-        assertEquals(tokens.size(), 11);
-        TextToken t = get(tokens, 8);
+        assertEquals(tokens.size(), 12);
+        TextToken t = get(tokens, 9);
         assertEquals(t.getText().trim(), "<Test>");
     }
 
     @DataProvider(name = "doctype_token_added_correctly_data")
     public Object[][] doctype_token_added_correctly_data()
     {
-        return new Object[][]{{"xhtml1_strict_doctype.tml", "html", "-//W3C//DTD XHTML 1.0 Strict//EN",
-                               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"}, {"xhtml1_transitional_doctype.tml",
-                                                                                      "html",
-                                                                                      "-//W3C//DTD XHTML 1.0 Transitional//EN",
-                                                                                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"},
-                                                                                     {"xhtml1_frameset_doctype.tml",
-                                                                                      "html",
-                                                                                      "-//W3C//DTD XHTML 1.0 Frameset//EN",
-                                                                                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"},
-                                                                                     {"html4_strict_doctype.tml",
-                                                                                      "HTML",
-                                                                                      "-//W3C//DTD HTML 4.01//EN",
-                                                                                      "http://www.w3.org/TR/html4/strict.dtd"},
-                                                                                     {"html4_transitional_doctype.tml",
-                                                                                      "HTML",
-                                                                                      "-//W3C//DTD HTML 4.01 Transitional//EN",
-                                                                                      "http://www.w3.org/TR/html4/loose.dtd"},
-                                                                                     {"html4_frameset_doctype.tml",
-                                                                                      "HTML",
-                                                                                      "-//W3C//DTD HTML 4.01 Frameset//EN",
-                                                                                      "http://www.w3.org/TR/html4/frameset.dtd"},
-                                                                                     {"system_doctype.xml", "foo", null,
-                                                                                      "src/test/resources/org/apache/tapestry/internal/services/simple.dtd"}};
+        return new Object[][]{
+
+                {"xhtml1_strict_doctype.tml", "html", "-//W3C//DTD XHTML 1.0 Strict//EN",
+                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"},
+
+                {"xhtml1_transitional_doctype.tml", "html", "-//W3C//DTD XHTML 1.0 Transitional//EN",
+                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"},
+
+                {"xhtml1_frameset_doctype.tml", "html", "-//W3C//DTD XHTML 1.0 Frameset//EN",
+                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"},
+
+                {"html4_strict_doctype.tml", "HTML", "-//W3C//DTD HTML 4.01//EN",
+                 "http://www.w3.org/TR/html4/strict.dtd"},
+
+                {"html4_transitional_doctype.tml", "HTML", "-//W3C//DTD HTML 4.01 Transitional//EN",
+                 "http://www.w3.org/TR/html4/loose.dtd"},
+
+                {"html4_frameset_doctype.tml", "HTML", "-//W3C//DTD HTML 4.01 Frameset//EN",
+                 "http://www.w3.org/TR/html4/frameset.dtd"},
+
+                {"system_doctype.xml", "foo", null,
+                 "src/test/resources/org/apache/tapestry/internal/services/simple.dtd"}};
     }
 
     @Test(dataProvider = "doctype_token_added_correctly_data")

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/disabled_option.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/disabled_option.html?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/disabled_option.html (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/disabled_option.html Sat Dec 29 18:54:55 2007
@@ -1 +1,4 @@
-<select><option class="pixie" disabled="disabled" value="fred">Fred</option></select>
\ No newline at end of file
+<?xml version="1.0"?>
+<select>
+    <option class="pixie" disabled="disabled" value="fred">Fred</option>
+</select>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/just_options.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/just_options.html?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/just_options.html (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/just_options.html Sat Dec 29 18:54:55 2007
@@ -1 +1,5 @@
-<select><option value="fred">Fred Flintstone</option><option selected="selected" value="barney">Barney Rubble</option></select>
\ No newline at end of file
+<?xml version="1.0"?>
+<select>
+    <option value="fred">Fred Flintstone</option>
+    <option selected="selected" value="barney">Barney Rubble</option>
+</select>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_attributes.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_attributes.html?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_attributes.html (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_attributes.html Sat Dec 29 18:54:55 2007
@@ -1 +1,4 @@
-<select><option class="pixie" value="fred">Fred</option></select>
\ No newline at end of file
+<?xml version="1.0"?>
+<select>
+    <option class="pixie" value="fred">Fred</option>
+</select>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_group_attributes.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_group_attributes.html?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_group_attributes.html (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_group_attributes.html Sat Dec 29 18:54:55 2007
@@ -1 +1,7 @@
-<select><optgroup class="pixie" label="Husbands"><option selected="selected" value="Fred">Fred</option><option value="Barney">Barney</option></optgroup></select>
\ No newline at end of file
+<?xml version="1.0"?>
+<select>
+    <optgroup class="pixie" label="Husbands">
+        <option selected="selected" value="Fred">Fred</option>
+        <option value="Barney">Barney</option>
+    </optgroup>
+</select>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups.html?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups.html (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups.html Sat Dec 29 18:54:55 2007
@@ -1 +1,11 @@
-<select><optgroup label="Husbands"><option selected="selected" value="Fred">Fred</option><option value="Barney">Barney</option></optgroup><optgroup disabled="disabled" label="Wives"><option value="Wilma">Wilma</option><option value="Betty">Betty</option></optgroup></select>
\ No newline at end of file
+<?xml version="1.0"?>
+<select>
+    <optgroup label="Husbands">
+        <option selected="selected" value="Fred">Fred</option>
+        <option value="Barney">Barney</option>
+    </optgroup>
+    <optgroup disabled="disabled" label="Wives">
+        <option value="Wilma">Wilma</option>
+        <option value="Betty">Betty</option>
+    </optgroup>
+</select>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups_precede_ungroup_options.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups_precede_ungroup_options.html?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups_precede_ungroup_options.html (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/corelib/components/option_groups_precede_ungroup_options.html Sat Dec 29 18:54:55 2007
@@ -1 +1,9 @@
-<select><optgroup label="Husbands"><option selected="selected" value="Fred">Fred</option><option value="Barney">Barney</option></optgroup><option value="Wilma">Wilma</option><option value="Betty">Betty</option></select>
\ No newline at end of file
+<?xml version="1.0"?>
+<select>
+    <optgroup label="Husbands">
+        <option selected="selected" value="Fred">Fred</option>
+        <option value="Barney">Barney</option>
+    </optgroup>
+    <option value="Wilma">Wilma</option>
+    <option value="Betty">Betty</option>
+</select>
\ No newline at end of file

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/namespaced_elements.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/namespaced_elements.txt?rev=607501&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/namespaced_elements.txt (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/namespaced_elements.txt Sat Dec 29 18:54:55 2007
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<f:root xmlns:b="barneyns" xmlns:f="fredns"><f:nested><b:deepest/></f:nested></f:root>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/nested_elements.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/nested_elements.txt?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/nested_elements.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/dom/nested_elements.txt Sat Dec 29 18:54:55 2007
@@ -1,4 +1 @@
-<population>
-  <person first-name="Fred" last-name="Flintstone"></person>
-  <person first-name="Barney" last-name="Rubble"></person>
-</population>
\ No newline at end of file
+<population><person first-name="Fred" last-name="Flintstone"></person><person first-name="Barney" last-name="Rubble"></person></population>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script_links.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script_links.txt?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script_links.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script_links.txt Sat Dec 29 18:54:55 2007
@@ -1 +1,2 @@
+<?xml version="1.0"?>
 <html><body><script src="foo.js" type="text/javascript"/><script src="bar/baz.js" type="text/javascript"/><p>Ready to be updated with scripts.</p></body></html>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_style_links.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_style_links.txt?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_style_links.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_style_links.txt Sat Dec 29 18:54:55 2007
@@ -1 +1,2 @@
-<html><head><link href="foo.css" rel="stylesheet" type="text/css"/><link href="bar/baz.css" media="print" rel="stylesheet" type="text/css"/></head><body><p>Ready to be updated with styles.</p></body></html>
\ No newline at end of file
+<?xml version="1.0"?>
+<html><head><link href="foo.css" rel="stylesheet" type="text/css"/><link href="bar/baz.css" media="print" rel="stylesheet" type="text/css"/></head><body><p>Ready to be updated with styles.</p></body></html>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/duplicate_scripts_ignored_first_media_wins.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/duplicate_scripts_ignored_first_media_wins.txt?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/duplicate_scripts_ignored_first_media_wins.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/duplicate_scripts_ignored_first_media_wins.txt Sat Dec 29 18:54:55 2007
@@ -1 +1,2 @@
+<?xml version="1.0"?>
 <html><head><link href="foo.css" rel="stylesheet" type="text/css"/><link href="bar/baz.css" media="print" rel="stylesheet" type="text/css"/></head><body><p>Ready to be updated with styles.</p></body></html>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/existing_head_used_if_present.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/existing_head_used_if_present.txt?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/existing_head_used_if_present.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/existing_head_used_if_present.txt Sat Dec 29 18:54:55 2007
@@ -1 +1,2 @@
+<?xml version="1.0"?>
 <html><head><link href="foo.css" rel="stylesheet" type="text/css"/><!-- existing head --></head><body>body content</body></html>

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/namespaced_element.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/namespaced_element.tml?rev=607501&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/namespaced_element.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/namespaced_element.tml Sat Dec 29 18:54:55 2007
@@ -0,0 +1,3 @@
+<foo:bar xmlns:foo="http://foo.com" foo:biff="baz">
+    <gnip/>
+</foo:bar>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/no_body_element.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/no_body_element.txt?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/no_body_element.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/no_body_element.txt Sat Dec 29 18:54:55 2007
@@ -1 +1,2 @@
+<?xml version="1.0"?>
 <html><notbody><p>Ready to be updated with scripts.</p></notbody></html>

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java Sat Dec 29 18:54:55 2007
@@ -36,10 +36,16 @@
     {
         if (_lock)
         {
+            // This is how I would think it would be:
+
             // [0] is getStackTrace()
             // [1] is innerCheck()
             // [2] is check() or lock()
             // [3] is caller of check() or lock()
+
+            // ... so why do we get element 4?  Found this via trial and error.  Some extra stack frame
+            // gets in there somehow, as in, getStackTrace() must be calling something (probably native)
+            // that creates the actual array, and includes itself as [0], getStackTrace() as [1], etc.
 
             StackTraceElement element = Thread.currentThread().getStackTrace()[4];
 

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/pipeline.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/pipeline.apt?rev=607501&r1=607500&r2=607501&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/pipeline.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/pipeline.apt Sat Dec 29 18:54:55 2007
@@ -4,7 +4,10 @@
  
 Building Pipelines
 
-  A common pattern within Tapestry is the use of filtering pipelines.  
+  A common pattern within Tapestry is the use of filtering pipelines.   Another name
+  for a pipeline is a <filter chain>; an example of this is the Filter and FilterChain
+  interfaces inside the Servlet API.
+
   In this pattern, an existing service is decorated with a filter.
   The filter will delegate to the service, but has the chance to
   alter or replace parameters before invoking the method, and