# HG changeset patch # User paulb # Date 1128366672 0 # Node ID 59fdbcae2113c4671e18e8f8760d5cd0d00d1f79 # Parent d175f4ef1ed5ad5a680e10974769ad4814dd123d [project @ 2005-10-03 19:11:12 by paulb] Switched to using input/initialiser stylesheets, restricting additional transformations to those filtering the choices in the output. diff -r d175f4ef1ed5 -r 59fdbcae2113 examples/Common/Configurator/__init__.py --- a/examples/Common/Configurator/__init__.py Mon Oct 03 19:10:29 2005 +0000 +++ b/examples/Common/Configurator/__init__.py Mon Oct 03 19:11:12 2005 +0000 @@ -22,13 +22,24 @@ resource_dir = os.path.join(os.path.split(__file__)[0], "Resources") encoding = "utf-8" template_resources = { - "configuration" : ["config_template.xhtml", "config_output.xsl"] + "configuration" : ("config_template.xhtml", "config_output.xsl") + } + init_resources = { + "configuration" : ("config_template.xhtml", "config_input.xsl") } transform_resources = { - "database" : ["config_database.xsl"] + "filter" : ["config_filter.xsl"] } document_resources = { - "database" : "config_database.xml" + "accessories" : "config_accessories.xml", + "base-system" : "config_base_system.xml", + "cpu" : "config_cpu.xml", + "hard-disk" : "config_hard_disk.xml", + "keyboard" : "config_keyboard.xml", + "memory-unit" : "config_memory_unit.xml", + "mouse" : "config_mouse.xml", + "screen" : "config_screen.xml", + "storage-unit" : "config_storage_unit.xml" } in_page_resources = { "cpu" : ("config_output_cpu.xsl", "cpu-node"), @@ -79,9 +90,24 @@ # Transform, adding enumerations/ranges. - database_xsl = self.prepare_transform("database") - database_xml = self.prepare_document("database") - proc = XSLOutput.Processor(database_xsl, references={"database" : database_xml}) + init_xsl = self.prepare_initialiser("configuration") + proc = XSLOutput.Processor([init_xsl], references={ + "accessories" : self.prepare_document("accessories"), + "base-system" : self.prepare_document("base-system"), + "cpu" : self.prepare_document("cpu"), + "hard-disk" : self.prepare_document("hard-disk"), + "keyboard" : self.prepare_document("keyboard"), + "memory-unit" : self.prepare_document("memory-unit"), + "mouse" : self.prepare_document("mouse"), + "screen" : self.prepare_document("screen"), + "storage-unit" : self.prepare_document("storage-unit") + }) + configuration = proc.get_result(configuration) + + # Filter out inappropriate choices. + + filter_xsl_list = self.prepare_transform("filter") + proc = XSLOutput.Processor(filter_xsl_list) configuration = proc.get_result(configuration) # Start the response.