Mercurial > genshi > mirror
comparison doc/xml-templates.txt @ 703:af57b12e3dd2 experimental-match-fastpaths
merge in trunk up through r818 - fundamentally changed the way MatchSet works, but actually is more consistent now
author | aflett |
---|---|
date | Mon, 31 Mar 2008 22:47:50 +0000 |
parents | 54964f7d2253 |
children | ea46fb523485 |
comparison
equal
deleted
inserted
replaced
701:52a597419c0d | 703:af57b12e3dd2 |
---|---|
320 in the output of the match template. See `Using XPath`_ for more information | 320 in the output of the match template. See `Using XPath`_ for more information |
321 about this function. | 321 about this function. |
322 | 322 |
323 .. _`Using XPath`: streams.html#using-xpath | 323 .. _`Using XPath`: streams.html#using-xpath |
324 | 324 |
325 Match templates are applied both to the original markup as well to the | |
326 generated markup. The order in which they are applied depends on the order | |
327 they are declared in the template source: a match template defined after | |
328 another match template is applied to the output generated by the first match | |
329 template. The match templates basically form a pipeline. | |
330 | |
325 This directive can also be used as an element: | 331 This directive can also be used as an element: |
326 | 332 |
327 .. code-block:: genshi | 333 .. code-block:: genshi |
328 | 334 |
329 <div> | 335 <div> |
350 The following optimization hints are recognized: | 356 The following optimization hints are recognized: |
351 | 357 |
352 +---------------+-----------+-----------------------------------------------+ | 358 +---------------+-----------+-----------------------------------------------+ |
353 | Attribute | Default | Description | | 359 | Attribute | Default | Description | |
354 +===============+===========+===============================================+ | 360 +===============+===========+===============================================+ |
361 | ``buffer`` | ``true`` | Whether the matched content should be | | |
362 | | | buffered in memory. Buffering can improve | | |
363 | | | performance a bit at the cost of needing more | | |
364 | | | memory during rendering. Buffering is | | |
365 | | | ''required'' for match templates that contain | | |
366 | | | more than one invocation of the ``select()`` | | |
367 | | | function. If there is only one call, and the | | |
368 | | | matched content can potentially be very long, | | |
369 | | | consider disabling buffering to avoid | | |
370 | | | excessive memory use. | | |
371 +---------------+-----------+-----------------------------------------------+ | |
355 | ``once`` | ``false`` | Whether the engine should stop looking for | | 372 | ``once`` | ``false`` | Whether the engine should stop looking for | |
356 | | | more matching elements after the first match. | | 373 | | | more matching elements after the first match. | |
357 | | | Use this on match templates that match | | 374 | | | Use this on match templates that match | |
358 | | | elements that can only occur once in the | | 375 | | | elements that can only occur once in the | |
359 | | | stream, such as the ``<head>`` or ``<body>`` | | 376 | | | stream, such as the ``<head>`` or ``<body>`` | |