You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2002/11/16 20:21:13 UTC

Input Module Problem: Invalid pattern

Hi,

I am trying to modify a request parameter 'query', based on the value 
of another request parameter 'region', before passing 'query' to the 
SearchGenerator.

I am trying to use the DefaultsMetaModule in 2.1-dev, and am getting 
unexpected exceptions.

javax.xml.transform.TransformerException: 
org.apache.xalan.xsltc.TransletException: 
org.apache.xalan.xsltc.TransletException: 
org.apache.cocoon.ProcessingException: Failed to load sitemap from 
file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/search.xmap: 
org.apache.avalon.framework.configuration.ConfigurationException: 
Invalid pattern '+(doc@search:archive) +({default:query})' at 
file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/search.xmap:35:88

This concatenation works in another version of this sitemap, where I do 
not use Input Modules.

Here is the sitemap matcher (its the only one in this sitemap):

<map:match pattern="">
  <map:select type="parameter">	    <!-- test 'query' param -->
   <map:parameter name="parameter-selector-test" 
value="{default:query}"/>
   <map:when test="">                <!-- there is no query -->
    <map:generate type="search"/>
   </map:when>
   <map:otherwise>                   <!-- there is a query -->
    <map:select type="parameter">	<!-- test 'region' param -->
     <map:parameter name="parameter-selector-test" 
value="{default:region}"/>
     <map:when test="archive">       <!-- 'region' param = "archive" -->
      <map:generate type="search">   <!-- modify the query to only 
search the archive -->
       <map:parameter name="query"
		value="+(doc@search:archive) +({default:query})"/>
                      <!-- error @ 35:88 is here  ^ -->
      </map:generate>
     </map:when>
     <map:when test="library">
      <map:generate type="search">
       <map:parameter name="query" value="+(doc@search:library) 
+({default:query})"/>
      </map:generate>
     </map:when>
	<!-- etc. -->
     <map:otherwise>
      <map:generate type="search">
       <map:parameter name="query" value="{default:query}"/>
      </map:generate>
     </map:otherwise>
    </map:select>
   </map:otherwise>
  </map:select>
  <map:transform src="parts/xsl/search2menu.xsl">
   <map:parameter name="prefix" value="{default:iniva-url}"/>
  </map:transform>
  <map:serialize/>
</map:match>

and here is the relevant snippet from cocoon.xconf:

<component-instance
   class="org.apache.cocoon.components.modules.input.DefaultsMetaModule"
   logger="core.modules.input" name="defaults">
  <input-module name="request-param"/>
   <values>
    <query></query>
    <region>all</region>
    <iniva-url>http://iborg.local:8080/cocoon/iniva/</iniva-url>
   </values>
</component-instance>

Can anyone see what I am doing wrong?

thanks for any help

regards Jeremy


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>