A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/873.html
Document ID: 873
Branch: main
Language: default
Name: XPathTraversableGenerator (unchanged)
Document Type: Sitemap Component (unchanged)
Updated on: 3/27/08 9:15:57 PM
Updated by: Luca Morandini
A new version has been created, state: draft
Parts
=====
Long description
----------------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 3249 bytes (previous version: 2536 bytes)
Content diff:
<html>
<body>
--- <p>Generates an XML collection listing performing XPath queries on XML
sources.
--- It can be used both as a plain TraversableGenerator or, if an XPath is
--- specified, it will perform an XPath query on every XML resource, where "xml
--- resource" is, by default, any resource ending with ".xml", which can be
--- overriden by setting the (regexp) pattern <tt>xmlFiles</tt> (this has the
effect
--- of increasing, not limiting, the scope of the search) as a sitemap
parameter, or
+++ <p>It will perform an XPath query on every XML resource, where "xml
resource"
+++ is, by default, any resource ending with ".xml", which can be overriden by
+++ setting the (regexp) pattern <tt>xmlFiles</tt> (this has the effect of
+++ increasing, not limiting, the scope of the search) as a sitemap parameter,
or
where the name of the resource has a container-wide mime-type mapping to
'text/xml' such as specified by mime-mapping elements in a web.xml
descriptor
file. The XPath can be specified in two ways:</p>
(13 equal lines skipped)
<pre><strong>Sitemap:</strong>
<map:match pattern="documents/**">
--- <map:generate type="xpathdirectory"
src="docs/{1}#/article/title|/article/abstract" >
+++ <map:generate type="xpathtraversable"
src="docs/{1}#/article/title|/article/abstract" >
<map:parameter name="xmlFiles" value="\.xml$"/>
</map:generate>
<map:serialize type="xml"/>
(25 equal lines skipped)
<tt><map:parameter name="xmlns:<em>your prefix</em>"
value="nsURI"/**"></tt></p>
+++ <p><strong>Another </strong><strong>sample usage:</strong></p>
+++
+++ <pre> <map:match pattern="pages.xml">
+++ <map:generate type="xpathtraversable" src="blockcontext:/">
+++ <map:parameter name="depth" value="4"/>
+++ <map:parameter name="exclude" value="xslt$|xmap$"/>
+++ <map:parameter name="xmlFiles" value="\.jx$"/>
+++ <map:parameter name="xpath" value="/*/content/title"/>
+++ </map:generate>
+++ <map:serialize type="xml"/>
+++ </map:match>
+++ </pre>
+++
+++ <p><strong>This sitemap fragment will execute the
"<tt>/*/content/title</tt>"
+++ XPath expression for all XML files (including the ones ending with
+++ "<tt>.jx</tt>" but excluding the ones ending with "<tt>xslt</tt>" or
+++ "<tt>xmap</tt>") for a depth of 4 nesting across every block defined in the
+++ current block.</strong></p>
+++
</body>
</html>