You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tom Place <ps...@nottingham.ac.uk> on 2003/02/11 22:13:08 UTC

xsp util and file contents

Hi,

I’m trying to insert xml into my xsp, this xml is for navigation
purposes so ideally I would like to use one navigation file in many
different xsp documents.
I have looked at the mail archive to find out the details about this but
I cant seam to get it to work!

My example is below:

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

<xsp:page language="java" 
              xmlns:xsp="http://apache.org/xsp"
	  xmlns:util=”http://apache.org/xsp/util/2.0”>
    <xsp:logic>
      XSPUtil u = new XSPUtil();
      String navigation =
u.getFileContents(/tomcat/webapps/cocoon/autorevs/docs/templates/logged-
out-navigation.xml);
      <util:include-expr>
        <util:expr>
          <xsp:expr>navigation</xsp:expr>
        </util:expr>
      </util:include-expr>
    </xsp:logic>
</xsp:page>

I am getting compilation errors – any ideas?

Cheers

Tom 
 



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: xsp util and file contents

Posted by Tom Place <ps...@nottingham.ac.uk>.
Thanks for your help.

Just to clarify, you mean put an XSL transform between the XSP page and
the original XSL transformer?

This could work however is there not an easier way of doing this as I am
going to be inserting several different things at several points on
different sheets - this will take a lot of XSL files!

Going back to my original example, should that not work, have I got the
wrong end of the stick?!?!

Also what is aggregation?

(Sorry but I'm new to all this!)

-----Original Message-----
From: Robert Simmons [mailto:derisor@arcor.de] 
Sent: 11 February 2003 21:39
To: cocoon-users@xml.apache.org
Subject: Re: xsp util and file contents

XSP is just XML. Just write a transformer that copies the XML into the
XSP
file. Run this transformer before you run the XSP transformer in the
sitemap
and viola, problem solved.

Hmm, I'm starting to get the hang of this thing .... scary.

-- Robert

----- Original Message -----
From: "Leszek Gawron" <ou...@vip.net.pl>
To: <co...@xml.apache.org>
Sent: Tuesday, February 11, 2003 10:33 PM
Subject: Re: xsp util and file contents


> On wto, lut 11, 2003 at 09:13:08 -0000, Tom Place wrote:
> > Hi,
> >
> > I'm trying to insert xml into my xsp, this xml is for navigation
> > purposes so ideally I would like to use one navigation file in many
> > different xsp documents.
> Apart from your problem : why don't you use aggregation?
> ouzo
> --
>             __
>          | /  \ |        Leszek Gawron            //  \\
>         \_\\  //_/      ouzo@vip.net.pl          _\\()//_
>          .'/()\'.     Phone: +48(600)341118     / //  \\ \
>           \\  //  recursive: adj; see recursive  | \__/ |
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: xsp util and file contents

Posted by Robert Simmons <de...@arcor.de>.
XSP is just XML. Just write a transformer that copies the XML into the XSP
file. Run this transformer before you run the XSP transformer in the sitemap
and viola, problem solved.

Hmm, I'm starting to get the hang of this thing .... scary.

-- Robert

----- Original Message -----
From: "Leszek Gawron" <ou...@vip.net.pl>
To: <co...@xml.apache.org>
Sent: Tuesday, February 11, 2003 10:33 PM
Subject: Re: xsp util and file contents


> On wto, lut 11, 2003 at 09:13:08 -0000, Tom Place wrote:
> > Hi,
> >
> > I'm trying to insert xml into my xsp, this xml is for navigation
> > purposes so ideally I would like to use one navigation file in many
> > different xsp documents.
> Apart from your problem : why don't you use aggregation?
> ouzo
> --
>             __
>          | /  \ |        Leszek Gawron            //  \\
>         \_\\  //_/      ouzo@vip.net.pl          _\\()//_
>          .'/()\'.     Phone: +48(600)341118     / //  \\ \
>           \\  //  recursive: adj; see recursive  | \__/ |
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: xsp util and file contents

Posted by Leszek Gawron <ou...@vip.net.pl>.
On wto, lut 11, 2003 at 09:13:08 -0000, Tom Place wrote:
> Hi,
> 
> I’m trying to insert xml into my xsp, this xml is for navigation
> purposes so ideally I would like to use one navigation file in many
> different xsp documents.
Apart from your problem : why don't you use aggregation?	
	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/      ouzo@vip.net.pl          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: xsp util and file contents

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 11.Feb.2003 -- 09:13 PM, Tom Place wrote:
> Hi,
> 
> I’m trying to insert xml into my xsp, this xml is for navigation
> purposes so ideally I would like to use one navigation file in many
> different xsp documents.
> I have looked at the mail archive to find out the details about this but
> I cant seam to get it to work!
> 
> My example is below:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <xsp:page language="java" 
>               xmlns:xsp="http://apache.org/xsp"
> 	  xmlns:util=”http://apache.org/xsp/util/2.0”>

      <content> <!-- mind you: xsp:logic outside first non xsp tag
	                 goes outside generate() method -->

         <util:include-file name="/tomcat/webapps/cocoon/autorevs/docs/templates/logged-out-navigation.xml"/>

      </content>

> </xsp:page>
> 
> I am getting compilation errors – any ideas?

Alternatives are aggregation (see samples) or any of the
*IncludeTransformers. 

	Chris.

Please follow up summarizing your problem and which suggested solution
/ information worked for you when you consider your problem
solved. Add "SUMMARY: " to the subject line. This will make FAQ
generation and searching the list easier. In addition, it makes
helping you more fun. Thank you.

And if you are really cool, add a page at http://wiki.cocoondev.org

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>