cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Benéteau <m.benet...@quaternove.fr>
Subject RE: XML Declaration
Date Tue, 19 Mar 2002 15:53:18 GMT
You may get a more explicit error message if you use the following error
handler in your pipeline :

      <map:handle-errors>
        <map:transform src="stylesheets/error2html.xsl"/>
        <map:serialize status-code="500"/>
      </map:handle-errors>

where "error2html.xsl" is the error stylesheet provided in the cocoon
default webapp (in webapp\stylesheets\system).


Matthieu

  -----Message d'origine-----
  De : cyril vidal [mailto:cyr.vidal@wanadoo.fr]
  Envoyé : mardi 19 mars 2002 16:26
  Objet : XML Declaration


  I hope one day I will succeed in transforming  XML->PDF  with Cocoon...
  After the "tranform" corrected, I now obtain the following message:
  message Exception in creating Transform Handler

  description org.apache.cocoon.ProcessingException: Exception in creating
Transform Handler: org.xml.sax.SAXParseException: The XML declaration may
only appear at the very beginning of the document

  This is my xml document:

  <?xml version="1.0"?>
  <sonnet type="Shakespearean">
    <author>
      <last-name>Shakespeare</last-name>
      <first-name>William</first-name>
      <nationality>British</nationality>
      <year-of-birth>1564</year-of-birth>
      <year-of-death>1616</year-of-death>
    </author>
    <title>Sonnet 130</title>
    <lines>
      <line>My mistress' eyes are nothing like the sun,</line>
      <line>Coral is far more red than her lips red.</line>
      <line>If snow be white, why then her breasts are dun,</line>
      <line>If hairs be wires, black wires grow on her head.</line>
      <line>I have seen roses damasked, red and white,</line>
      <line>But no such roses see I in her cheeks.</line>
      <line>And in some perfumes is there more delight</line>
      <line>Than in the breath that from my mistress reeks.</line>
      <line>I love to hear her speak, yet well I know</line>
      <line>That music hath a far more pleasing sound.</line>
      <line>I grant I never saw a goddess go,</line>
      <line>My mistress when she walks, treads on the ground.</line>
      <line>And yet, by Heaven, I think my love as rare</line>
      <line>As any she belied with false compare.</line>
    </lines>
  </sonnet>

  and the summary of the XLS-fo one:

  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <xsl:template match="/">
      <xsl:apply-templates select="sonnet"/>
    </xsl:template>

  <xsl:template match="sonnet">

  <xsl:processing-instruction
        name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
  ....

  </xsl:stylesheet>

  What do you think is wrong?

  Thanks for your answers,

  Cyril.



  Thanks for your answer,

  Cyril.

Mime
View raw message