Hi all.

 

I'm facing a really strange issue.  The function below does call 2
different pipelines depending on the outcome of  file.exists().  

 

************************************************************************
**

function getXMLFile(filePath) {

      var file = new File(filePath);

      if (file.exists()) {

            cocoon.sendPage("file/xml/path/" + filePath);

      } else {

            var exception = new FileNotFoundException(filePath);

            cocoon.sendPage(

              "fileNotFoundException", 

              {

                  "exception": exception

              }

          );

      }

}

************************************************************************
**

 

 

The corresponding sitemap snippets are:

************************************************************************
**

      <!-- 

       | {1}: filePath

       -->            

      <map:match pattern="file/xml/path/**">

        <map:generate src="{1}" />

        <map:serialize type="xml" />

      </map:match>

 

      <map:match pattern="fileNotFoundException">

        <map:generate src="exceptionhandling/FileNotFoundException.jx"
type="jx"/>

        <map:serialize type="xml"/>

      </map:match>  

************************************************************************
**

 

And FileNotFoundException,jx looks like:

************************************************************************
**

 

<?xml version="1.0" encoding="UTF-8"?>

<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>

  <FileNotFoundException>

    <Message>

      ${exception}

    </Message>  

  </FileNotFoundException>

</jx:template>

************************************************************************
**

 

 

If I call the 'fileNotFoundException' pipeline directly, I get the
expected output.

************************************************************************
**

<FileNotFoundException>

  <Message>    

  </Message>

</FileNotFoundException>

************************************************************************
**

 

But when the getXMLFile enters the else {} block I get an xml parse
exception:

 

************************************************************************
**

XML-parsefout: syntaxisfout

Locatie:
http://localhost:8888/shared/file/newschema/product/BUK9MPP-55PRR/releas
ed4

Regelnummer 4, kolom 7:      java.io.FileNotFoundException:
/Products/BUK9MPP-55PRR/BUK9MPP-55PRR.xml

------^

 

 

Source:

<parsererror
xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml";>XML-parsefo
ut: syntaxisfout

Locatie:
http://localhost:8888/shared/file/newschema/product/BUK9MPP-55PRR/releas
ed4

Regelnummer 4, kolom 7:<sourcetext>      java.io.FileNotFoundException:
/Products/BUK9MPP-55PRR/BUK9MPP-55PRR.xml

------^</sourcetext></parsererror>

 

 

Anybody who can explain what could be wrong with my setup?  

 

Thx in advance,

Robby Pelssers

Reply via email to