1.1 --- a/examples/Common/Recursive/__init__.py Sun Jan 21 00:22:40 2007 +0000
1.2 +++ b/examples/Common/Recursive/__init__.py Sun Jan 21 00:23:27 2007 +0000
1.3 @@ -7,6 +7,14 @@
1.4 import XSLForms.Utils
1.5 import os
1.6
1.7 +# Site map imports.
1.8 +
1.9 +from WebStack.Resources.Selectors import EncodingSelector
1.10 +
1.11 +# Configuration settings.
1.12 +
1.13 +encoding = "utf-8"
1.14 +
1.15 # Resource classes.
1.16
1.17 class RecursiveResource(XSLForms.Resources.WebResources.XSLFormsResource):
1.18 @@ -14,7 +22,6 @@
1.19 "A resource providing a recursive hierarchy of editable fields."
1.20
1.21 resource_dir = os.path.join(os.path.split(__file__)[0], "Resources")
1.22 - encoding = "utf-8"
1.23 template_resources = {
1.24 "recursive" : ("recursive_template.xhtml", "recursive_output.xsl")
1.25 }
1.26 @@ -54,7 +61,7 @@
1.27
1.28 # Start the response.
1.29
1.30 - trans.set_content_type(WebStack.Generic.ContentType("application/xhtml+xml", self.encoding))
1.31 + trans.set_content_type(WebStack.Generic.ContentType("application/xhtml+xml", encoding))
1.32
1.33 # Ensure that an output stylesheet exists.
1.34
1.35 @@ -73,7 +80,8 @@
1.36
1.37 # Get the main resource and the directory used by the application.
1.38
1.39 - return RecursiveResource()
1.40 + resource = RecursiveResource()
1.41 + return EncodingSelector(resource, encoding)
1.42
1.43 # Resource preparation ahead of time - useful for making installations.
1.44