cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C├ędric Damioli <cedric.dami...@anyware-tech.com>
Subject Re: sessionstate matcher usage: What's wrong?
Date Thu, 21 Mar 2002 14:54:17 GMT
hi,

you don't use the writeDOMsession in a proper way :
the "dom-name" represents the name of the DOM stored in session
the "dom-root-element" does NOT represent the root node of the stored 
DOM (leading to something like : <dom><Elements>....</Elements></dom>)
, 
but the trigger element of the incoming SAX events which causes the 
Transformation to begin.
In other words, you may try <map:parameter name="dom-root-element" 
value="Elements"/> and it may match your needs.


KOZLOV Roman wrote:

>Hello Christian,
>
>Thank you very much for response. I've not found any "designations" substring in
>core.log. For the moment I've divided the match on two matches - one for read and
>one for write (just for tests).
>The match for write is:
>
> <map:match pattern="get_lub">
>     <map:generate
>src="xmldb:xindice://localhost:4080/db/data/somecollection/#//Some_Element"/>
>     <map:transform src="stylesheets/render_query.xsl"/>
>     <map:transform type="writeDOMsession">
>         <map:parameter name="dom-name" value="designations"/>
>         <map:parameter name="dom-root-element" value="dom"/>
>     </map:transform>
>     <map:serialize type="xml"/>
> </map:match>
>
>For this match I get empty response.
>What's the matter? If I comment writeDOMsession transformer then I get xml like
>this:
>
> <?xml version="1.0" encoding="iso-8859-1" ?>
> <Elements xmlns:collection="http://apache.org/cocoon/xmldb/1.0">
>  <Element id="ID_XXX">. . . </Element>
>. . .
> </Elements>
>
>However, when writeDOMsession transformer is used then response is empty and in
>core.log I can see:
>
>HttpProcessor[8080][0]/XMLDBSource: Querying collection
>xmldb:xindice://localhost:4080/db/data/somecollection/; query= //Some_Element
>FATAL_E (2002-03-21) 16:54.20:649   [core.xslt-processor] (/bdl/get_lub)
>HttpProcessor[8080][0]/TraxErrorHandler: Error in TraxTransformer:
>javax.xml.transform.TransformerException: java.lang.NullPointerException
>javax.xml.transform.TransformerException: java.lang.NullPointerException
> at
>org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1230)
>
> at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3139)
> at java.lang.Thread.run(Thread.java:484)
>---------
>java.lang.NullPointerException
> at
>org.apache.cocoon.transformation.WriteDOMSessionTransformer.storePrefixMapping(WriteDOMSessionTransformer.java:183)
>
> at
>org.apache.cocoon.transformation.WriteDOMSessionTransformer.startPrefixMapping(WriteDOMSessionTransformer.java:120)
>
> at
>org.apache.xalan.transformer.ResultTreeHandler.startAndAddPrefixMappings(ResultTreeHandler.java:1107)
>
> at
>org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:941)
>
> at
>org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:306)
>
> at
>org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)
> at
>org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2186)
>
> at
>org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2012)
>
> at
>org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1175)
>
> at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3139)
> at java.lang.Thread.run(Thread.java:484)
>
>
>    Looking forward to your help.
>    Thank you in advance.
>        Roman
>
>
>Christian Haul wrote:
>
>>On 21.Mar.2002 -- 12:07 PM, KOZLOV Roman wrote:
>>
>>>processed, so that writeDOMsession is called always. Could you please
>>>point to errors?
>>>
>>>   <map:match pattern="get_lub">
>>>       <map:match type="sessionstate" pattern="**">
>>>           <map:parameter name="attribute-name" value="designations"/>
>>>           <map:transform type="readDOMsession">
>>>               <map:parameter name="dom-name" value="designations"/>
>>>               <map:parameter name="trigger-element" value="/"/>
>>>               <map:parameter name="position" value="in"/>
>>>           </map:transform>
>>>           <map:serialize type="xml"/>
>>>       </map:match>
>>>
>>>       <map:generate
>>>src="xmldb:xindice://localhost:4080/db/data/somecollection/#//Some_Element"/>
>>>
>>>       <map:transform src="stylesheets/render_query.xsl"/>
>>>       <map:transform type="writeDOMsession">
>>>           <map:parameter name="dom-name" value="designations"/>
>>>           <map:parameter name="dom-root-element" value="dom"/>
>>>       </map:transform>
>>>       <map:serialize type="xml"/>
>>>   </map:match>
>>>
>>Roman,
>>you seem to be missing a <map:generate/> in the upper
>>pipeline. Anyway, could you check with core.log (?) that your session
>>actually contains an attribute called "designations"?
>>
>>        Chris.
>>
>>--
>>C h r i s t i a n       H a u l
>>haul@informatik.tu-darmstadt.de
>>    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>>For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>>For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>>



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

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


Mime
View raw message