# HG changeset patch # User paulb # Date 1107049818 0 # Node ID 868b164a441210f69a0ea4fc02e908916488317a # Parent ad08b0ca3e980157cf4866384849e95b94250fa5 [project @ 2005-01-30 01:50:18 by paulb] Added an extension function which adds "new" attributes/fields in the output form (and thus documents made from subsequently processed requests). diff -r ad08b0ca3e98 -r 868b164a4412 XSLForms/Output.py --- a/XSLForms/Output.py Tue Jan 25 17:00:47 2005 +0000 +++ b/XSLForms/Output.py Sun Jan 30 01:50:18 2005 +0000 @@ -104,8 +104,12 @@ def multi_field_name(context, multivalue_name): return path_to_context(context, 1, multivalue_name) +def new_field(context, name): + return path_to_context(context, 0) + "/" + name + libxslt.registerExtModuleFunction("this-position", "http://www.boddie.org.uk/ns/xmltools/template", this_position) libxslt.registerExtModuleFunction("field-name", "http://www.boddie.org.uk/ns/xmltools/template", field_name) libxslt.registerExtModuleFunction("multi-field-name", "http://www.boddie.org.uk/ns/xmltools/template", multi_field_name) +libxslt.registerExtModuleFunction("new-field", "http://www.boddie.org.uk/ns/xmltools/template", new_field) # vim: tabstop=4 expandtab shiftwidth=4