cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@cocoon.zones.apache.org
Subject [DAISY] Updated: XPathTraversableGenerator
Date Thu, 27 Mar 2008 21:16:07 GMT
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>
    &lt;map:match pattern="documents/**"&gt;
--- 	&lt;map:generate type="xpathdirectory" src="docs/{1}#/article/title|/article/abstract"
&gt;
+++ 	&lt;map:generate type="xpathtraversable" src="docs/{1}#/article/title|/article/abstract"
&gt;
         		&lt;map:parameter name="xmlFiles" value="\.xml$"/&gt;
    	&lt;/map:generate&gt;
    	&lt;map:serialize type="xml"/&gt; 
(25 equal lines skipped)
    <tt>&lt;map:parameter name="xmlns:<em>your prefix</em>"
    value="nsURI"/**"&gt;</tt></p>
    
+++ <p><strong>Another </strong><strong>sample usage:</strong></p>
+++ 
+++ <pre>      &lt;map:match pattern="pages.xml"&gt;
+++         &lt;map:generate type="xpathtraversable" src="blockcontext:/"&gt;
+++           &lt;map:parameter name="depth" value="4"/&gt;
+++           &lt;map:parameter name="exclude" value="xslt$|xmap$"/&gt;
+++           &lt;map:parameter name="xmlFiles" value="\.jx$"/&gt; 
+++           &lt;map:parameter name="xpath" value="/*/content/title"/&gt;
+++         &lt;/map:generate&gt;
+++         &lt;map:serialize type="xml"/&gt;
+++       &lt;/map:match&gt;
+++ </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>


Mime
View raw message