cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janet Yvan <Yja...@dsmdir.cea.fr>
Subject Sitemap catching exceptions
Date Tue, 19 Jul 2005 09:53:17 GMT
Hi all.

 

In my webapp, I have to deal with externally generated data. These data are
not every time valid XML, so I need to catch parsing exceptions and then to
continue generating my page. So I designed a special pipeline which was
meant to handle parse errors. When I directly call the pipeline, the errors
are caught and an empty page is generated. But when I try to load the whole
page, it sends me a parse error … I don’t understand why …

 

Thanks in advance.

Yvan

 

Here are some pieces of my sitemap :

 

<!—Pipeline which retrieves external data -->

<map:pipeline type="noncaching">

      <map:match pattern="**/annonces.drfmc">

            <map:generate
src="http://w10-drfmc.saclay.cea.fr/Phocea/Xml/Seminaires"/>

            <map:serialize type="xml"/>

      </map:match>

 

      <map:match pattern="**/annonces.ext.xml">

            <map:aggregate element="seminaires">

                  <map:part src="cocoon:/{1}/annonces.drfmc"/>

                  <map:part src="cocoon:/{1}/annonces.drecam"/>

                  <map:part src="cocoon:/{1}/annonces.dapnia"/>

            </map:aggregate>

            <map:serialize type="xml"/>

      </map:match>

 

<map:handle-errors>

                  <map:select type="exception">

                        <map:when test="document-does-not-exist">

                              <map:generate
src="../../content/util/empty.xml"/>

                        <map:serialize type="xml"/>

                  </map:when>

                  <map:otherwise>

                              <map:generate
src="../../content/util/empty.xml"/>

                        <map:serialize type="xml"/>

                  </map:otherwise>

            </map:select>

      </map:handle-errors>

</map:pipeline>

 

<map:pipeline>

<map:match pattern="**/annonces.html">

            <map:aggregate element="cmsbody" label="src">

                  <map:part src="cocoon:/{1}/mymenu.xml"/>       

                  <map:part src="cocoon:/{1}/annonces.ext.xml"/>

                  <map:part src="cocoon:/{1}/annonces.xml"/>

            </map:aggregate>

            <map:transform src="./xslt/annonce2xhtml.xsl" label="toto">

                  <map:parameter name="use-request-parameters"
value="true"/>

                  <map:parameter name="root" value="/dsm/live"/>

            </map:transform>

            <map:serialize type="xhtml"/>

      </map:match>

</map:pipeline>


Mime
View raw message