On Wed, 2008-10-08 at 01:50 +0200, Florent André wrote: > This mail is an answer to this mail : Re: [Forum module] work with > collection and Cinclude
Next time just change the subject like: [Debugging] see the stream anywhere in a sitemap (was [Forum module] work with collection and Cinclude) > I modify the title in order to <map:match pattern="better"> to the > discussion : > > In order to seralize the stream before a transformation you suggest me to : > > > You have > > <map:match pattern="*.xml/*/*/*/*"> > > > > So just request in your browser. The outcome should be xml and you can > > see what goes into the transformation. > > but, in my opinion this tip has two "problems" > 1 - the stream is "cut" when the map:serialize is throw Yes that is the whole idea of debugging. Imaging a video of someone climbing a mountain and someone else recording it with a cam. If the climber falls and later analyze why, the most repeated part of this video probably is the one just before the fall. This is because the climber wants to learn why (s)he fall to not and fix this mistake in the future. The quickest way to get a point in time of pipeline processing is terminating the match with a serialize. I do not care about what happens next since I need to determine the problem why the next is not working like I want. > 2 - when the sitemap has many "redirection" (=<map:generate > src="cocoon:/feedContent/news/{1}/{2}/{3}/{4}/{5}"/>) it's difficult to > write a well formed request in the browser Make it static then. You are debugging. Do not debug the most abstract match. Create your own match="test" one and request what you need. I am talking all the time of debugging - I asked for the incoming xml of the problematic xsl. > 3 - when I do that in a module's sitemap (eg news module), I have the error > page that display on the site What is the error? What is the url you request? > So, after some research in the lenya code, I found this solution : > Before the transformation put this code : > > <map:transform > src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl"> > <map:parameter name="source" > value="context://lenya/pubs/debugDOC.xsl"/> > </map:transform> > <map:transform type="write-source"> > <map:parameter name="serializer" value="xml"/> > </map:transform> > <map:transform > src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/> > > and : > - the stream is writing in the pubs/debugDOC.xsl > - the sitemap processing is not disturbed > > What do you think about this solution ? It does what I asked just with the write-source transformer. That is fine please post that to the other thread. > > However, the debugDOC.xsl is a "one line" xml... that is not very friendly. > I try to add a <xsl:output indent="yes"/> in the addSourceTags.xsl, but > it's don't work... If you have any ideas : they are welcome !! > ( I use the linux program xmlindent for create an indented debugDOC, but > this is not very simple) Again you are debugging. I am using eclipse and xml buddy. In case I have an one line xml I copy it to a tmp doc in eclipse and format it there. salu2 > > Have a good day > > On Sat, 04 Oct 2008 22:58:49 +0200, Thorsten Scherler <[EMAIL PROTECTED]> > wrote: > > On Thu, 2008-10-02 at 01:20 +0200, Florent André wrote: > >> Thank you for this answer Thorsten > >> > >> I will be more precise in the future. > >> > >> You ask me to give the xml file before .xsl. > >> > >> " > >> > Put a <map:serialize type="xml"/> here to see what goes in > >> > collection2html.xsl. > >> " > >> But I have a "problem" with <map:serialize> : If I put a <map:serialize> > >> before collection2html.xsl, the serialized xml will be transform with > > other > >> <map:match> (the stream is redirected by other map:generator). > > > > I am talking about debugging. Meaning my suggestion is that you debug > > just the one match not the whole pipeline. General rule of thumb for > > debugging is keep it small to pin down the problem. > > > > You have > > <map:match pattern="*.xml/*/*/*/*"> > > > > So just request in your browser. The outcome should be xml and you can > > see what goes into the transformation. > > > > > >> So, in order to display the stream before transformation by > >> collection2html.xsl, I see this options : > >> 1 - reorder the sitemap in order to have the collection2html in the last > >> position -- I think it's a very bad solution > >> 2 - use <map:view> -- I try that in the module's subsitemap : the result > > in > >> web-browser is : no content > >> 3 - use a serializer that write a file on the file system -- What is the > >> serializer defining in Lenya ? I search him in editor's sitemap, but I > >> don't find it from now... > >> > > > > All of the above sounds way too much fuzz. Just add the serializer, > > request the match pattern and see what is the result. > > > > salu2 > > > >> > >> And, for the : > >> > > >> > Yeah, see above basic violation of the whole concept of the pipeline. > >> I guarantee you that I don't redo that ! > >> > >> have a good day > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > -- > > Thorsten Scherler thorsten.at.apache.org > > Open Source Java consulting, training and solutions > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Thorsten Scherler thorsten.at.apache.org Open Source Java consulting, training and solutions --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]