1.1 --- a/examples/Common/Configurator/__init__.py Mon Oct 03 19:10:29 2005 +0000
1.2 +++ b/examples/Common/Configurator/__init__.py Mon Oct 03 19:11:12 2005 +0000
1.3 @@ -22,13 +22,24 @@
1.4 resource_dir = os.path.join(os.path.split(__file__)[0], "Resources")
1.5 encoding = "utf-8"
1.6 template_resources = {
1.7 - "configuration" : ["config_template.xhtml", "config_output.xsl"]
1.8 + "configuration" : ("config_template.xhtml", "config_output.xsl")
1.9 + }
1.10 + init_resources = {
1.11 + "configuration" : ("config_template.xhtml", "config_input.xsl")
1.12 }
1.13 transform_resources = {
1.14 - "database" : ["config_database.xsl"]
1.15 + "filter" : ["config_filter.xsl"]
1.16 }
1.17 document_resources = {
1.18 - "database" : "config_database.xml"
1.19 + "accessories" : "config_accessories.xml",
1.20 + "base-system" : "config_base_system.xml",
1.21 + "cpu" : "config_cpu.xml",
1.22 + "hard-disk" : "config_hard_disk.xml",
1.23 + "keyboard" : "config_keyboard.xml",
1.24 + "memory-unit" : "config_memory_unit.xml",
1.25 + "mouse" : "config_mouse.xml",
1.26 + "screen" : "config_screen.xml",
1.27 + "storage-unit" : "config_storage_unit.xml"
1.28 }
1.29 in_page_resources = {
1.30 "cpu" : ("config_output_cpu.xsl", "cpu-node"),
1.31 @@ -79,9 +90,24 @@
1.32
1.33 # Transform, adding enumerations/ranges.
1.34
1.35 - database_xsl = self.prepare_transform("database")
1.36 - database_xml = self.prepare_document("database")
1.37 - proc = XSLOutput.Processor(database_xsl, references={"database" : database_xml})
1.38 + init_xsl = self.prepare_initialiser("configuration")
1.39 + proc = XSLOutput.Processor([init_xsl], references={
1.40 + "accessories" : self.prepare_document("accessories"),
1.41 + "base-system" : self.prepare_document("base-system"),
1.42 + "cpu" : self.prepare_document("cpu"),
1.43 + "hard-disk" : self.prepare_document("hard-disk"),
1.44 + "keyboard" : self.prepare_document("keyboard"),
1.45 + "memory-unit" : self.prepare_document("memory-unit"),
1.46 + "mouse" : self.prepare_document("mouse"),
1.47 + "screen" : self.prepare_document("screen"),
1.48 + "storage-unit" : self.prepare_document("storage-unit")
1.49 + })
1.50 + configuration = proc.get_result(configuration)
1.51 +
1.52 + # Filter out inappropriate choices.
1.53 +
1.54 + filter_xsl_list = self.prepare_transform("filter")
1.55 + proc = XSLOutput.Processor(filter_xsl_list)
1.56 configuration = proc.get_result(configuration)
1.57
1.58 # Start the response.