cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: SSF and UI modularization
Date Thu, 27 Mar 2008 14:21:17 GMT
On Mar 27, 2008, at 4:31 AM, Luca Morandini wrote:
> Vadim Gritsenko wrote:
>> On Mar 26, 2008, at 5:19 PM, Luca Morandini wrote:
>>>
>>> ... though... why is it returning every document in sight, instead  
>>> of limiting itself to the "*.jx" ones ?
>>>
>>>     <map:match pattern="pages.xml">
>>>       <map:generate type="xpathtraversable" src="blockcontext:/">
>>>         <map:parameter name="depth" value="4"/>
>>>         <map:parameter name="xmlFiles" value="\.jx"/>
>> Perhaps because of this method?
>>    protected boolean isXML(TraversableSource path) {
>>        String mimeType = this.context.getMimeType(path.getName());
>>        return this.xmlRE.match(path.getName()) || "text/ 
>> xml".equalsIgnoreCase(mimeType);
>>    }
>
> Actually, I thought xmlFiles was a way to restrict the scope of the  
> search, not to enlarge it... it seems I was utterly wrong :(
>
> The Javadoc says: <<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  
> "xmlFiles 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.>>
>
> So, it seems the correct behavior, given my setup, would be: add  
> "*.jx" files to the known list of XML resources within the depth of  
> 4 and perform the XPath query.

I think you just need to set rootRE/includeRE/excludeRE parameters.


> If you could confirm this, I would be glad to add some documentation  
> to the XPathTraversableGenerator page.

Yes above description is correct.

Vadim


>>>         <map:parameter name="xpath" value="/*/content/title"/>
>> This parameter is optional, so you can omit it and get a better  
>> performance.
>
> I understand this is a performance-killer, but I need the "title"  
> element for further processing.
>
> Regards,
>
> --------------------
>   Luca Morandini
> www.lucamorandini.it
> --------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message