cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ernst.nuste...@eunet.at
Subject xsp:pi to dynamically create a style sheet name
Date Sun, 04 Jun 2000 11:10:16 GMT
Hi folks,

weather is very beatuiful outside, but I have to code :-)) and I have
this problem:

I try to create an XSP where the name of the corresponding xsl is
created dynamically depending on some parameters given to the program.

To try this, I used Stefanos xsp-("my first xsp")page and added the
xsp:pi code from the documentation,

When I call the page in the browser (netscape):

http://localhost/page.xml?page-html.xsl

 I get an exception:


My source code looks like this:


!***********    page.xml       ******************


<?xml version="1.0"?>

<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
<!-- Version: $Id: page.xml,v 1.5 2000/01/08 07:19:41 ricardo Exp $ -->

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>

<!-- **** THIS DOES NOT WOK **** -->

<xsp:pi name="xml-stylesheet">

      href="<xsp:expr>request.getQueryString()</xsp:expr>"
      type="text/xsl"

</xsp:pi>

<!-- ***** THIS WOULD WORK ****

    <?xml-stylesheet href="page-html.xsl" type="text/xsl"?>

-->

<xsp:page
  language="java"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>
  <!-- Class for exec... -->

...........................................

I receive this exception:


! ********** ERROR:



                                          Error found handling the
request.

      org.xml.sax.SAXParseException: The markup in the document
following the root element must be well-formed.
              at
org.apache.cocoon.parser.AbstractParser.fatalError(Compiled Code)
              at
org.apache.xerces.framework.XMLParser.reportError(Compiled Code)
              at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(Compiled
Code)
              at
org.apache.xerces.framework.XMLDocumentScanner.abortMarkup(Compiled
Code)
              at
org.apache.xerces.framework.XMLDocumentScanner$TrailingMiscDispatcher.dispatch(Compiled
Code)
              at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled Code)
              at org.apache.xerces.framework.XMLParser.parse(Compiled
Code)
              at org.apache.cocoon.parser.XercesParser.parse(Compiled
Code)
              at org.apache.cocoon.parser.AbstractParser.parse(Compiled
Code)
              at
org.apache.cocoon.producer.ProducerFromFile.getDocument(Compiled Code)
              at org.apache.cocoon.Engine.handle(Compiled Code)
              at org.apache.cocoon.Cocoon.service(Compiled Code)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at
org.apache.jserv.JServConnection.processRequest(Compiled Code)
              at org.apache.jserv.JServConnection.run(Compiled Code)
              at java.lang.Thread.run(Compiled Code)

 Warning: this page has been dynamically generated.

               Copyright (c) 1999-2000 The Apache XML Project.
                            All rights reserved.


Can any kind soul give me a hint what I did wrong?


Thanks a lot!


Ernst





Mime
View raw message