XSLTools

README.txt

182:dd93b1723e89
2005-07-22 paulb [project @ 2005-07-22 20:32:51 by paulb] Reformatted the JavaScript function call.
     1 Introduction
     2 ------------
     3 
     4 XSLTools is a collection of modules and packages facilitating the development
     5 of applications based on XML, XSL stylesheets and transformations, notably Web
     6 applications involving complicated Web forms potentially consisting of
     7 editable hierarchical structures and potentially involving "live" or "in-page"
     8 dynamic updates to portions of those Web forms.
     9 
    10 Quick Start
    11 -----------
    12 
    13 Try running the demo:
    14 
    15 python tools/demo.py
    16 
    17 An introductory guide to creating applications can be found in the docs
    18 directory - see docs/index.html for the start page.
    19 
    20 Contact, Copyright and Licence Information
    21 ------------------------------------------
    22 
    23 The current Web page for XSLTools at the time of release is:
    24 
    25 http://www.boddie.org.uk/python/XSLTools.html
    26 
    27 Copyright and licence information can be found in the docs directory - see
    28 docs/LICENCE.txt and docs/LICENCE-Sarissa.txt for more information.
    29 
    30 Dependencies
    31 ------------
    32 
    33 XSLTools has the following basic dependencies:
    34 
    35 Package                     Release Information
    36 -------                     -------------------
    37 
    38 libxml2dom                  0.2
    39 libxml2                     2.6.16
    40 libxslt                     1.1.12
    41 
    42 The example Web applications require WebStack (release 0.10 or later).
    43 
    44 Notes on In-Page Update Functionality
    45 -------------------------------------
    46 
    47 Special note: Konqueror seems to remember replaced form content (when
    48 replaceChild is used to replace regions of the page which include form
    49 elements). This causes the browser to believe that more form fields exist on
    50 the page than actually do so, and subsequent form submissions thus include the
    51 values of such removed fields. A special hack is in place to disable form
    52 fields by changing their names, thus causing Konqueror to not associate such
    53 fields with the real, active fields; this hack does not seem to cause problems
    54 for Mozilla.
    55 
    56 Various browsers (eg. Mozilla/Firefox, Konqueror) will not allow the
    57 XMLHttpRequest in-page updates to function unless the application URL defined
    58 within the Configurator application (and other relevant applications) matches
    59 the URL at which the browser finds the application. This URL is deduced by the
    60 various applications using the WebStack API, but it is possible that the
    61 values returned by that API do not match the actual addresses entered into the
    62 address bar of the browser.
    63 
    64 To check the behaviour of the applications, it is possible to view the
    65 document source of the pages served by applications and to verify that the
    66 URLs mentioned in the JavaScript function calls (to 'requestUpdate') involve a
    67 URL similar to that which appears in the browser's address bar. In some
    68 environments, the use of 'localhost' addresses often confuses the browser and
    69 server; one workaround is to use real host names or addresses instead of
    70 'localhost'.
    71 
    72 Choosing an element-path:
    73 
    74 When specifying the "context" of the in-page update, one must imagine which
    75 element the template fragment should operate within. If the template:id
    76 attribute marks a particular section, then the element-path should be a path
    77 to the applicable context element for that section in the complete template
    78 document. Note that if a template:element attribute appears on the same
    79 element as the template:id attribute then the element-path should refer to the
    80 element specified in the template:element attribute.
    81 
    82 Choosing where to put template:attribute, template:id and id:
    83 
    84 When specifying the extent of a template fragment, one must be sure not to put
    85 the template:id attribute on the same element as a template:attribute
    86 annotation; otherwise, the generated code will be improperly extracted as a
    87 fragment producing two versions of the element - one for when the specified
    88 attribute is present, and one for when it is not present. Generally,
    89 template:id and id can be placed on the same node, however.
    90 
    91 Stable element ordering and element-path:
    92 
    93 Within the element-path, the numbering of the elements will start at 1.
    94 Therefore it is vital to choose a region of the form data structure with the
    95 element-path which is isolated from surrounding elements whose positions would
    96 otherwise be dependent on a stable ordering of elements, and whose processing
    97 would be disrupted if some new elements suddenly appeared claiming the same
    98 positions in the document. For example:
    99 
   100   <item value="">         .../item$1/value
   101     <type value=""/>      .../item$1/type$1/value
   102     <comment value=""/>   .../item$1/comment$2/value
   103   </item>
   104 
   105   In-page update...
   106 
   107   <comment value=""/>     .../item$1/comment$1/value
   108 
   109 Notes on XSL
   110 ------------
   111 
   112 libxslt seems to be quite liberal on the definition of runtime parameters, in
   113 that there is no apparent need to explicitly declare the corresponding global
   114 variables in stylesheets. Whilst this is nice, we may eventually need to
   115 detect such variables and add them in the preparation process.