# HG changeset patch # User paulb # Date 1128818896 0 # Node ID 35993d0075d9ce16e5e6f453d8f2719555fe1c95 # Parent c1cc24a11a82b910c6fd28114e0cdb619e08c804 [project @ 2005-10-09 00:48:16 by paulb] Changed the in-page update code to use prepare_parameters. Removed XSLOutput usage, replacing it with get_result usage. diff -r c1cc24a11a82 -r 35993d0075d9 examples/Common/Configurator/__init__.py --- a/examples/Common/Configurator/__init__.py Sun Oct 09 00:47:47 2005 +0000 +++ b/examples/Common/Configurator/__init__.py Sun Oct 09 00:48:16 2005 +0000 @@ -5,7 +5,6 @@ import WebStack.Generic import XSLForms.Utils import XSLForms.Resources -from XSLTools import XSLOutput import os # Site map imports. @@ -91,46 +90,42 @@ # Transform, adding enumerations/ranges. 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 = self.get_result([init_xsl], configuration, + 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) + configuration = self.get_result(filter_xsl_list, configuration) # Start the response. trans.set_content_type(WebStack.Generic.ContentType("application/xhtml+xml", self.encoding)) - # Define the stylesheet parameters. - - stylesheet_parameters = {} - # Ensure that an output stylesheet exists. if in_page_resource in self.in_page_resources.keys(): trans_xsl = self.prepare_fragment("configuration", in_page_resource) - element_path = parameters.get("element-path", [""])[0] - stylesheet_parameters["element-path"] = element_path + stylesheet_parameters = self.prepare_parameters(parameters) else: trans_xsl = self.prepare_output("configuration") + stylesheet_parameters = {} # Complete the response. self.send_output(trans, [trans_xsl], configuration, stylesheet_parameters) + #from XSLTools import XSLOutput #import sys #proc = XSLOutput.Processor([trans_xsl], parameters=stylesheet_parameters) #proc.send_output(sys.stderr, "iso-8859-1", configuration)