Changeset 3194:4357b0add4ee in livinglogic.python.xist

Show
Ignore:
Timestamp:
01/29/08 18:32:27 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Replace <arg> with <var>.

Location:
docs
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • docs/XIST_Advanced.xml

    r3189 r3194  
    127127<section><h>Conversion targets</h> 
    128128 
    129 <p>The <arg>converter</arg> argument passed to the <meth>convert</meth> 
     129<p>The <$1var>converter</arg> argument passed to the <meth>convert</meth> 
    130130method has an attribute <lit>target</lit> which is a module or pool and 
    131131specifies the target namespace to which <self/> should be converted.</p> 
     
    158158 
    159159<p>The default target for conversion is <mod>ll.xist.ns.html</mod>. 
    160 Other targets can be specified via the <arg>target</arg> argument in the 
     160Other targets can be specified via the <$1var>target</arg> argument in the 
    161161<class>Converter</class> constructor or the <meth>conv</meth> method:</p> 
    162162 
  • docs/XIST_Howto.xml

    r3189 r3194  
    6969__init__(self, *content, **attrs) 
    7070</prog> 
    71 <p>Positional arguments (i.e. items in <arg>content</arg>) 
     71<p>Positional arguments (i.e. items in <var>content</var>) 
    7272will be the child nodes of the element node. Keyword arguments will be attributes. 
    7373You can pass most of Python's builtin types to such a constructor. 
     
    137137<dl> 
    138138<dt><lit>parsestring(data, base=None, encoding=None, **builderargs)</lit></dt> 
    139 <dd>Parse the string <arg>data</arg> into an &xist; tree.</dd> 
     139<dd>Parse the string <var>data</var> into an &xist; tree.</dd> 
    140140<dt><lit>parseiter(iterable, base=None, encoding=None, **builderargs)</lit></dt> 
    141 <dd>Parse the input from the iterable <arg>iterable</arg> (which must produce the 
     141<dd>Parse the input from the iterable <var>iterable</var> (which must produce the 
    142142input in chunks of bytes) into an &xist; tree.</dd> 
    143143<dt><lit>parsestream(stream, base=None, encoding=None, bufsize=8192, **builderargs)</lit></dt> 
    144 <dd>Parse &xml; from the stream <arg>stream</arg> into an &xist; tree.</dd> 
     144<dd>Parse &xml; from the stream <var>stream</var> into an &xist; tree.</dd> 
    145145<dt><lit>parsefile(filename, base=None, encoding=None, bufsize=8192, **builderargs)</lit></dt> 
    146 <dd>Parse &xml; input from the file named <arg>filename</arg>.</dd> 
     146<dd>Parse &xml; input from the file named <var>filename</var>.</dd> 
    147147<dt><lit>parseurl(name, base=None, encoding=None, bufsize=8192, headers=None, data=None, **builderargs)</lit></dt> 
    148 <dd>Parse &xml; input from the &url; <arg>name</arg> into an &xist; tree.</dd> 
     148<dd>Parse &xml; input from the &url; <var>name</var> into an &xist; tree.</dd> 
    149149<dt><lit>parseetree(tree, base=None, **builderargs)</lit></dt> 
    150 <dd>Parse &xml; input from the object <arg>tree</arg> which must support the 
     150<dd>Parse &xml; input from the object <var>tree</var> which must support the 
    151151<a href="http://effbot.org/zone/element-index.htm">ElementTree</a> &api;.</dd> 
    152152</dl> 
     
    210210calls 
    211211<pyref module="ll.xist.xsc" class="Node" method="convert"><meth>convert</meth></pyref> 
    212 with a default <pyref module="ll.xist.converters" class="Converter"><arg>converter</arg></pyref> 
     212with a default <pyref module="ll.xist.converters" class="Converter"><var>converter</var></pyref> 
    213213argument. We'll come to converters in a minute. 
    214214<pyref module="ll.xist.xsc" class="Node" method="bytes"><meth>bytes</meth></pyref> 
     
    272272<pyref module="ll.xist.converters" class="Converter"><class>Converter</class></pyref> constructor:</p> 
    273273<dl> 
    274 <dt><arg>root</arg></dt><dd><arg>root</arg> (which defaults to <lit>None</lit>) is the root &url; 
     274<dt><var>root</var></dt><dd><var>root</var> (which defaults to <lit>None</lit>) is the root &url; 
    275275for the conversion process. When you want to resolve a link in some of your own <meth>convert</meth> methods, 
    276276the &url; must be interpreted relative to this root &url; (You can use 
    277277<pyref module="ll.xist.xsc" class="URLAttr" method="forInput"><meth>URLAttr.forInput</meth></pyref> 
    278278for that).</dd> 
    279 <dt><arg>mode</arg></dt><dd><arg>mode</arg> (which defaults to <lit>None</lit>) works the same way 
     279<dt><var>mode</var></dt><dd><var>mode</var> (which defaults to <lit>None</lit>) works the same way 
    280280as modes in &xslt;. You can use this for implementing different conversion modes.</dd> 
    281 <dt><arg>stage</arg></dt><dd><arg>stage</arg> (which defaults to <lit>"deliver"</lit>) 
     281<dt><var>stage</var></dt><dd><var>stage</var> (which defaults to <lit>"deliver"</lit>) 
    282282allows you to implement multi stage conversion: Suppose that you want to deliver a dynamically 
    283283constructed web page with &xist; that contains results from a database query and the current time. 
     
    285285every request. The query is done every few minutes and the resulting &html; tree is 
    286286stored in the servlet (using any of the available Python servlet technologies). 
    287 For this conversion the <arg>stage</arg> would be <lit>"cache"</lit> and your database &xml; 
    288 element would do the query when <lit><arg>stage</arg>=="cache"</lit>. Your time display element 
    289 would do the conversion when <lit><arg>stage</arg>=="deliver"</lit> and simply returns itself 
    290 when <lit><arg>stage</arg>=="cache"</lit>, so it would still be part of the cached &xml; tree 
     287For this conversion the <var>stage</var> would be <lit>"cache"</lit> and your database &xml; 
     288element would do the query when <lit><var>stage</var>=="cache"</lit>. Your time display element 
     289would do the conversion when <lit><var>stage</var>=="deliver"</lit> and simply returns itself 
     290when <lit><var>stage</var>=="cache"</lit>, so it would still be part of the cached &xml; tree 
    291291and would be converted to &html; on every request.</dd> 
    292 <dt><arg>target</arg></dt><dd><arg>target</arg> (which defaults to 
     292<dt><var>target</var></dt><dd><var>target</var> (which defaults to 
    293293<pyref module="ll.xist.ns.html"><mod>ll.xist.ns.html</mod></pyref>) specifies what the output should be. 
    294294Values must be <pyref module="ll.xist.xsc" class="Namespace">namespace subclasses</pyref> 
    295295(see below for an explanation of namespaces).</dd> 
    296 <dt><arg>lang</arg></dt><dd><p><arg>lang</arg> (which defaults to <lit>None</lit>) is the language 
     296<dt><var>lang</var></dt><dd><p><var>lang</var> (which defaults to <lit>None</lit>) is the language 
    297297in which the result tree should be. This can be used in the <meth>convert</meth> method 
    298298to implement different conversions for different languages, e.g.:</p> 
     
    776776 
    777777<section><h>Specifying an encoding</h> 
    778 <p>You can specify the encoding with the parameter <arg>encoding</arg> 
     778<p>You can specify the encoding with the parameter <var>encoding</var> 
    779779(with the encoding specified in an &xml; declaration being the default, if there 
    780780is no such declaration <lit>"utf-8"</lit> is used). Unencodable characters will 
     
    824824 
    825825<section><h>&html; compatibility</h> 
    826 <p>Another useful parameter is <arg>xhtml</arg>, 
     826<p>Another useful parameter is <var>xhtml</var>, 
    827827it specifies whether you want pure &html; or &xhtml; as output:</p> 
    828828 
     
    845845 
    846846<p>By default &xist; doesn't output any namespace declarations. The simplest 
    847 way to change that, is to pass <lit>True</lit> for the <arg>prefixdefault</arg> 
     847way to change that, is to pass <lit>True</lit> for the <var>prefixdefault</var> 
    848848argument when publishing:</p> 
    849849 
     
    902902 
    903903<p>When elements from more than one namespace are present in the tree, 
    904 <arg>prefixdefault</arg> is unreliable. The first namespace encountered will 
    905 get the prefix specified by <arg>prefixdefault</arg>, all others will get a 
     904<var>prefixdefault</var> is unreliable. The first namespace encountered will 
     905get the prefix specified by <var>prefixdefault</var>, all others will get a 
    906906different prefix. &xist; will never use the same prefix for different namespaces. 
    907907&xist; will also refuse to use an empty prefix for global attributes:</p> 
     
    946946</prog> 
    947947 
    948 <p>In the case of multiple namespaces you can use the <arg>prefixes</arg> 
     948<p>In the case of multiple namespaces you can use the <var>prefixes</var> 
    949949argument to specify an explicit prefix for each namespace. So we could change 
    950950the publishing statement from our example above to:</p> 
     
    979979 
    980980<p>Finally it's possible to suppress output of namespace declarations 
    981 for certain namespaces by using the <arg>hidexmlns</arg> attribute:</p> 
     981for certain namespaces by using the <var>hidexmlns</var> attribute:</p> 
    982982</section> 
    983983 
  • docs/XIST_Misc.xml

    r3189 r3194  
    3131<lit>root</lit> &url; when you parse local files.</li> 
    3232<li>When you parse remote web pages you can either 
    33 omit the <arg>base</arg> argument, so it will default to the 
     33omit the <$1var>base</arg> argument, so it will default to the 
    3434&url; being parsing, so that links, images, etc. on the page 
    3535will still point back to their original location, or you 
     
    131131Python code in the content returns. The processing instruction content is treated as the body 
    132132of a function, so you can put multiple return statements there. 
    133 The converter is available as the parameter <arg>converter</arg> inside 
     133The converter is available as the parameter <$1var>converter</arg> inside 
    134134the processing instruction. For example, consider the following &xml; file:</p> 
    135135