You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Eric Dalquist <eb...@mtu.edu> on 2002/07/11 17:35:44 UTC

[Q] util:include-uri relative path

I'm wondering if I can use include-uri to include the output of an XSP in
another XSP. I can get it to work if I use the full path but I don't want to
do it this way unless I can use a relative path. The file is being included
in site_format.xsp which is used as a style sheet for index.xsp

Here is the working include:
<util:include-uri
href="http://www.incoherentramblings.net:8888/cocoon/nav_bar.xsp"/>

I would like to do:
<util:include-uri href="nav_bar.xsp"/>

Here is my dir structure:
<TOMCAT_HOME>/
    webapps/
        cocoon/
            sitemap.xmap
            logic/
                site_format.xsp
                nav_bar.xsp
                index.xsp
            stylesheets/
                nav_bar.xsl
                index.xsl


Here is an experpt from my sitemap:


            <!--
             | This is the ONLY special style sheet in the site. It is
generate so that
             | the nav bar, which is constant on all pages, can be dynamic.
             -->
            <map:match pattern="site_format.xsl">
                <map:generate type="serverpages"
src="logic/site_format.xsp"/>
                <map:serialize type="xml"/>
            </map:match>
            <!--
             | The navbar generator. We don't want to run the site_format on
this.
             -->
            <map:match pattern="nav_bar.xsp">
                <map:generate type="serverpages" src="logic/nav_bar.xsp"/>
                <map:transform src="stylesheets/nav_bar.xsl"/>
                <map:serialize type="xml"/>
            </map:match>

            <!--
             | Generate any .xsp file. We apply it's style sheet and then
the
             | main site stylesheet.
             -->
            <map:match pattern="*.xsp">
                <map:generate type="serverpages" src="logic/{1}.xsp"/>
                <map:transform src="cocoon:/site_format.xsl"/>
                <map:transform src="stylesheets/{1}.xsl"/>
                <map:serialize/>
            </map:match>




---------------------------------------------------------------------
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: [Q] util:include-uri relative path

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 12.Jul.2002 -- 08:42 AM, Vadim Gritsenko wrote:
> > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> >          try {
> >             newParser = (org.apache.cocoon.components.parser.Parser)
> > this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
> >             XSPUtil.include(this.resolver.resolve(<xsl:copy-of
> > select="$source-uri"/>).getInputSource(), this.contentHandler,
> newParser);
> 
> Ooooh, no! Sorry Chris, but why the hell parse source twice???

OK, must have overlooked the toSAX() method. Sorry.
Thanks for pointing it out.

BTW is there an *easy* way to stay up to date with Avalon API docs?
Sofar I've only managed to download a source distro occasionally since
the binary one seemed not to include them

Actually, I wouldn't mind to have the Avalon API docs included with C2...
Afterall, extending C2 is heavily based upon Avalon knowledge.

	Chris.
-- 
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>


Re: [Q] util:include-uri relative path

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 14.Jul.2002 -- 11:10 AM, Vadim Gritsenko wrote:
> > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> > 
> > On 12.Jul.2002 -- 10:58 PM, Christian Haul wrote:
> > > On 12.Jul.2002 -- 04:24 PM, Vadim Gritsenko wrote:
> > > > > From: Christian Haul
> [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> > >
> > > Now, if you really want to make this a happy evening for me, tell me
> why
> > > I can't use the logicsheet-util.xsl twice, and I'll promise to patch
> &
> > > commit the corrected util.xsl today :-)
> > 
> > Couldn't find the reason for this problem, but was able to find a way
> > around it.
> 
> What was the issue ?

When using the 'get-string-parameter' $namspace-prefix is set correctly 
the first time. Following calls to the same template have it set to "".
Maybe it's OK with the spec (Sylvain authored this logicsheet), but it's
unusable this way. I've settled with calling the 'get-namespce-prefix'
template everytime. This works OK for me.

> 
> > Fixes are in both branches.
> 
> What mymap is used for? :)

Touch'e. It's been left over and now is removed.

	Chris.
-- 
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>


RE: [Q] util:include-uri relative path

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> 
> On 12.Jul.2002 -- 10:58 PM, Christian Haul wrote:
> > On 12.Jul.2002 -- 04:24 PM, Vadim Gritsenko wrote:
> > > > From: Christian Haul
[mailto:haul@dvs1.informatik.tu-darmstadt.de]
> > >
> > > Hint: two start document events, two end document events.
> > >
> > > See my other email, my proposed patch uses include consumer.
> > > (not sure though why no output)
> >
> > Ah, beautiful! Yes!
> >
> > Now, if you really want to make this a happy evening for me, tell me
why
> > I can't use the logicsheet-util.xsl twice, and I'll promise to patch
&
> > commit the corrected util.xsl today :-)
> 
> Couldn't find the reason for this problem, but was able to find a way
> around it.

What was the issue ?


> Fixes are in both branches.

What mymap is used for? :)

Vadim

 
> 	Chris.
> --
> 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>


Re: [Q] util:include-uri relative path

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 12.Jul.2002 -- 10:58 PM, Christian Haul wrote:
> On 12.Jul.2002 -- 04:24 PM, Vadim Gritsenko wrote:
> > > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> > 
> > Hint: two start document events, two end document events.
> > 
> > See my other email, my proposed patch uses include consumer.
> > (not sure though why no output)
> 
> Ah, beautiful! Yes!
> 
> Now, if you really want to make this a happy evening for me, tell me why
> I can't use the logicsheet-util.xsl twice, and I'll promise to patch &
> commit the corrected util.xsl today :-)

Couldn't find the reason for this problem, but was able to find a way
around it. Fixes are in both branches.

	Chris.
-- 
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>


Re: [Q] util:include-uri relative path

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 12.Jul.2002 -- 04:24 PM, Vadim Gritsenko wrote:
> > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> 
> Hint: two start document events, two end document events.
> 
> See my other email, my proposed patch uses include consumer.
> (not sure though why no output)

Ah, beautiful! Yes!

Now, if you really want to make this a happy evening for me, tell me why
I can't use the logicsheet-util.xsl twice, and I'll promise to patch &
commit the corrected util.xsl today :-)

Problem (need 2.1 to illustrate):
In examples there's an example of including the colorized source of an
XSP in itself. (Server Pages -> Util) It uses exactly the bad approach
suggested earlier with a forgotten recycle(), but, anyway. If we fix
the issue with logicsheet-utils I will correct it :-)

Actually, it contains a string representation and the included colorized
source.

I've just corrected some paths so that it should work. Update from CVS.

But: only the first is displayed. Reason is the second call to get nested
parameters returns "". Hence when the first table is commented out,
the second (the colorized one) appears...

TIA,
	Chris.
-- 
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>


RE: [Q] util:include-uri relative path

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> 
> On 12.Jul.2002 -- 08:42 AM, Vadim Gritsenko wrote:
> > > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> > >       {
> > >          org.apache.cocoon.components.parser.Parser newParser =
null;
> > >          try {
> > >             newParser =
(org.apache.cocoon.components.parser.Parser)
> > >
this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
> > >             XSPUtil.include(this.resolver.resolve(<xsl:copy-of
> > > select="$source-uri"/>).getInputSource(), this.contentHandler,
> > newParser);
> >
> > Ooooh, no! Sorry Chris, but why the hell parse source twice???
> >
> > My thinking here is that everywhere else Cocoon uses resolver to
> > resolver URIs (and factory is deprecated). Thus, include-source is
not
> > needed and include-uri has to be refactored.
> >
> > >           } catch (Exception e) {
> > >               getLogger().error("Could not include source", e);
> > >           } finally {
> > >               if (newParser != null)
this.manager.release((Component)
> > > newParser);
> > >           }
> > >       }
> 
> OK, gimme a hint: why does the following result in no output at all
while the
> other one works fine?


Hint: two start document events, two end document events.

See my other email, my proposed patch uses include consumer.
(not sure though why no output)


Vadim

 
>     public static void includeSource(String uri, String base,
SourceResolver
> resolver, ContentHandler contentHandler)
>         throws RuntimeException {
> 
>         if (base != null) base = (base != "" ? base : null);
>         Source source = null;
>         try {
>             source = resolver.resolveURI(uri, base, null);
>             resolver.toSAX(source, contentHandler);
>           } catch (Exception e) {
>               throw new RuntimeException("Error including source
"+uri+"
> "+base+":"+e.getMessage());
>           } finally {
>               if (source != null)
>                  resolver.release(source);
>           }
>     }
> 
> Oh, of course I couldn't find an error message anywhere.
> 
> 	Chris.
> --
> 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>


Re: [Q] util:include-uri relative path

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 12.Jul.2002 -- 08:42 AM, Vadim Gritsenko wrote:
> > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> >       {
> >          org.apache.cocoon.components.parser.Parser newParser = null;
> >          try {
> >             newParser = (org.apache.cocoon.components.parser.Parser)
> > this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
> >             XSPUtil.include(this.resolver.resolve(<xsl:copy-of
> > select="$source-uri"/>).getInputSource(), this.contentHandler,
> newParser);
> 
> Ooooh, no! Sorry Chris, but why the hell parse source twice???
> 
> My thinking here is that everywhere else Cocoon uses resolver to
> resolver URIs (and factory is deprecated). Thus, include-source is not
> needed and include-uri has to be refactored.
> 
> 
> >           } catch (Exception e) {
> >               getLogger().error("Could not include source", e);
> >           } finally {
> >               if (newParser != null) this.manager.release((Component)
> > newParser);
> >           }
> >       }

OK, gimme a hint: why does the following result in no output at all while the
other one works fine?

    public static void includeSource(String uri, String base, SourceResolver resolver, ContentHandler contentHandler) 
        throws RuntimeException {
        
        if (base != null) base = (base != "" ? base : null);
        Source source = null;
        try {
            source = resolver.resolveURI(uri, base, null);
            resolver.toSAX(source, contentHandler);
          } catch (Exception e) {
              throw new RuntimeException("Error including source "+uri+" "+base+":"+e.getMessage());
          } finally {
              if (source != null)
                 resolver.release(source);
          }
    }

Oh, of course I couldn't find an error message anywhere.

	Chris.
-- 
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>


Re: [Q] util:include-uri relative path

Posted by Eric Dalquist <eb...@mtu.edu>.
I am going to take a look at it today.

-Eric Dalquist

----- Original Message -----
From: "Vadim Gritsenko" <va...@verizon.net>
To: <co...@xml.apache.org>; <ha...@dvs1.informatik.tu-darmstadt.de>;
"'Eric Dalquist'" <eb...@mtu.edu>
Sent: Friday, July 12, 2002 8:42 AM
Subject: RE: [Q] util:include-uri relative path


> > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> >
> > On 12.Jul.2002 -- 07:20 AM, Eric Dalquist wrote:
> > > My util.xsl doesn't have an include-source. There is include-uri,
> > > include-file & include-expr.
> >
> > Yeah, it's in 2.1 only. Might work just to copy this file from 2.1 and
> > recompile
> > 2.0.3 with it. Or try the snippet below and place it in your util.xsl:
> >
> >   <xsl:template match="util:get-source">
> >     <xsl:variable name="source-uri">
> >       <xsl:call-template name="get-string-parameter">
> >         <xsl:with-param name="name">uri</xsl:with-param>
> >       </xsl:call-template>
> >     </xsl:variable>
> >     <xsp:expr>
> >       XSPUtil.getSourceAsString(<xsl:copy-of select="$source-
> > uri"/>,this.resolver)
> >     </xsp:expr>
> >   </xsl:template>
> >
> >   <xsl:template match="util:include-source">
> >     <xsl:variable name="source-uri">
> >       <xsl:call-template name="get-string-parameter">
> >         <xsl:with-param name="name">uri</xsl:with-param>
> >       </xsl:call-template>
> >     </xsl:variable>
> >     <xsp:logic>
> >       {
> >          org.apache.cocoon.components.parser.Parser newParser = null;
> >          try {
> >             newParser = (org.apache.cocoon.components.parser.Parser)
> > this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
> >             XSPUtil.include(this.resolver.resolve(<xsl:copy-of
> > select="$source-uri"/>).getInputSource(), this.contentHandler,
> newParser);
>
> Ooooh, no! Sorry Chris, but why the hell parse source twice???
>
> My thinking here is that everywhere else Cocoon uses resolver to
> resolver URIs (and factory is deprecated). Thus, include-source is not
> needed and include-uri has to be refactored.
>
>
> >           } catch (Exception e) {
> >               getLogger().error("Could not include source", e);
> >           } finally {
> >               if (newParser != null) this.manager.release((Component)
> > newParser);
> >           }
> >       }
>
> And here is memory leak: no source.recycle().
>
>
> Eric,
>
> Have you modified your copy as I suggested? Is it working? There is a
> chance to have this resolved with 2.0.3 release on Monday...
>
> Vadim
>
>
> >     </xsp:logic>
> >   </xsl:template>
> >
> > Chris.
> > --
> > 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>
>


---------------------------------------------------------------------
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: [Q] util:include-uri relative path

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
> 
> On 12.Jul.2002 -- 07:20 AM, Eric Dalquist wrote:
> > My util.xsl doesn't have an include-source. There is include-uri,
> > include-file & include-expr.
> 
> Yeah, it's in 2.1 only. Might work just to copy this file from 2.1 and
> recompile
> 2.0.3 with it. Or try the snippet below and place it in your util.xsl:
> 
>   <xsl:template match="util:get-source">
>     <xsl:variable name="source-uri">
>       <xsl:call-template name="get-string-parameter">
>         <xsl:with-param name="name">uri</xsl:with-param>
>       </xsl:call-template>
>     </xsl:variable>
>     <xsp:expr>
>       XSPUtil.getSourceAsString(<xsl:copy-of select="$source-
> uri"/>,this.resolver)
>     </xsp:expr>
>   </xsl:template>
> 
>   <xsl:template match="util:include-source">
>     <xsl:variable name="source-uri">
>       <xsl:call-template name="get-string-parameter">
>         <xsl:with-param name="name">uri</xsl:with-param>
>       </xsl:call-template>
>     </xsl:variable>
>     <xsp:logic>
>       {
>          org.apache.cocoon.components.parser.Parser newParser = null;
>          try {
>             newParser = (org.apache.cocoon.components.parser.Parser)
> this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
>             XSPUtil.include(this.resolver.resolve(<xsl:copy-of
> select="$source-uri"/>).getInputSource(), this.contentHandler,
newParser);

Ooooh, no! Sorry Chris, but why the hell parse source twice???

My thinking here is that everywhere else Cocoon uses resolver to
resolver URIs (and factory is deprecated). Thus, include-source is not
needed and include-uri has to be refactored.


>           } catch (Exception e) {
>               getLogger().error("Could not include source", e);
>           } finally {
>               if (newParser != null) this.manager.release((Component)
> newParser);
>           }
>       }

And here is memory leak: no source.recycle().


Eric,

Have you modified your copy as I suggested? Is it working? There is a
chance to have this resolved with 2.0.3 release on Monday...

Vadim


>     </xsp:logic>
>   </xsl:template>
> 
> 	Chris.
> --
> 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>


Re: [Q] util:include-uri relative path

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 12.Jul.2002 -- 07:20 AM, Eric Dalquist wrote:
> My util.xsl doesn't have an include-source. There is include-uri,
> include-file & include-expr.

Yeah, it's in 2.1 only. Might work just to copy this file from 2.1 and recompile
2.0.3 with it. Or try the snippet below and place it in your util.xsl:

  <xsl:template match="util:get-source">
    <xsl:variable name="source-uri">
      <xsl:call-template name="get-string-parameter">
        <xsl:with-param name="name">uri</xsl:with-param>
      </xsl:call-template>
    </xsl:variable>
    <xsp:expr>
      XSPUtil.getSourceAsString(<xsl:copy-of select="$source-uri"/>,this.resolver)
    </xsp:expr>
  </xsl:template>

  <xsl:template match="util:include-source">
    <xsl:variable name="source-uri">
      <xsl:call-template name="get-string-parameter">
        <xsl:with-param name="name">uri</xsl:with-param>
      </xsl:call-template>
    </xsl:variable>
    <xsp:logic>
      {
         org.apache.cocoon.components.parser.Parser newParser = null;
         try {
            newParser = (org.apache.cocoon.components.parser.Parser) this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
            XSPUtil.include(this.resolver.resolve(<xsl:copy-of select="$source-uri"/>).getInputSource(), this.contentHandler, newParser);
          } catch (Exception e) {
              getLogger().error("Could not include source", e);
          } finally {
              if (newParser != null) this.manager.release((Component) newParser);
          }
      }
    </xsp:logic>
  </xsl:template>

	Chris.
-- 
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>


Re: [Q] util:include-uri relative path

Posted by Eric Dalquist <eb...@mtu.edu>.
My util.xsl doesn't have an include-source. There is include-uri,
include-file & include-expr.

-Eric

----- Original Message -----
From: "Christian Haul" <ha...@dvs1.informatik.tu-darmstadt.de>
To: <co...@xml.apache.org>
Sent: Friday, July 12, 2002 7:14 AM
Subject: Re: [Q] util:include-uri relative path


> On 11.Jul.2002 -- 10:03 PM, Vadim Gritsenko wrote:
> > > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> > >
> > > I just tried using cocoon://nav_bar.xsp but it still didn't work.
> > Looking in
> > > the core.log I found the following message:
> > >
> > > DEBUG   (2002-07-11) 13:19.09:225
> > [core.url-factory](/cocoon/index.xsp)
> > > Thread-6/URLFactoryImpl: Making URL from cocoon://nav_bar.xsp
> > > DEBUG   (2002-07-11) 13:19.09:225
> > [core.url-factory](/cocoon/index.xsp)
> > > Thread-6/URLFactoryImpl: Making URL - MalformedURLException in getURL:
> > > java.net.MalformedURLException: unknown protocol: cocoon
> > >  at java.net.URL.<init>(URL.java:586)
> > >  at java.net.URL.<init>(URL.java:476)
> > >  at java.net.URL.<init>(URL.java:425)
> > >  at
> > >
> > org.apache.cocoon.components.url.URLFactoryImpl.getURL(URLFactoryImpl.ja
> > va:1
> > > 18)
> > >  at org.apache.cocoon.www.logic.site_format_xsp.generate(C:\Program
> > > Files\Apache Group\Tomcat
> >
> > Hmmm... Looks like util logicsheet's code is quite outdated... Would you
> > mind patching util logicsheet (util.xsl)? It should use source resolver
> > to do the work.
>
> There's a util:include-source tag in util.xsl (2.1) that doesn't use
> URLFactory.  Maybe that one does it? So, should we have include-uri and
> include-source be the same then?
>
> Chris.
> --
> 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>
>



---------------------------------------------------------------------
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: [Q] util:include-uri relative path

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 11.Jul.2002 -- 10:03 PM, Vadim Gritsenko wrote:
> > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> > 
> > I just tried using cocoon://nav_bar.xsp but it still didn't work.
> Looking in
> > the core.log I found the following message:
> > 
> > DEBUG   (2002-07-11) 13:19.09:225
> [core.url-factory](/cocoon/index.xsp)
> > Thread-6/URLFactoryImpl: Making URL from cocoon://nav_bar.xsp
> > DEBUG   (2002-07-11) 13:19.09:225
> [core.url-factory](/cocoon/index.xsp)
> > Thread-6/URLFactoryImpl: Making URL - MalformedURLException in getURL:
> > java.net.MalformedURLException: unknown protocol: cocoon
> >  at java.net.URL.<init>(URL.java:586)
> >  at java.net.URL.<init>(URL.java:476)
> >  at java.net.URL.<init>(URL.java:425)
> >  at
> >
> org.apache.cocoon.components.url.URLFactoryImpl.getURL(URLFactoryImpl.ja
> va:1
> > 18)
> >  at org.apache.cocoon.www.logic.site_format_xsp.generate(C:\Program
> > Files\Apache Group\Tomcat
> 
> Hmmm... Looks like util logicsheet's code is quite outdated... Would you
> mind patching util logicsheet (util.xsl)? It should use source resolver
> to do the work.

There's a util:include-source tag in util.xsl (2.1) that doesn't use
URLFactory.  Maybe that one does it? So, should we have include-uri and
include-source be the same then?

	Chris.
-- 
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>


RE: [Q] util:include-uri relative path

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> 
> I'll look into patching it if you could give me a little more of a
path to
> follow ... like an example that uses the source revolver or API doc to
look
> at.

You may look into XSPFormValidatorHelper.getConfiguration(...) method,
it uses resolver.

Variable resolver is already defined in the scope of XSP, so no
additional steps are required. Patch may look similar to:

---------- Line 140 of util.xsl ---------------
String __name = String.valueOf(<xsl:copy-of select="$href"/>);
org.apache.cocoon.environment.Source __source = null;
try { 
    __source = resolver.resolve(__name);
    __source.toSAX(
        new org.apache.cocoon.xml.IncludeXMLConsumer(
            this.contentHandler));
} catch (Exception e) {
    getLogger().error("Could not include page", e);
} finally {
    if (__source != null) __source.recycle();
}
---------- Line 159 --------------------------


If it works, send to -dev or bugzilla.

PS This is patch for 2.0.3

PPS The good thing, this code will work even faster then old one when
using "cocoon://" protocol.


Vadim



> -Eric Dalquist
> 
> ----- Original Message -----
> From: "Vadim Gritsenko" <va...@verizon.net>
> To: <co...@xml.apache.org>
> Sent: Thursday, July 11, 2002 10:03 PM
> Subject: RE: [Q] util:include-uri relative path
> 
> 
> > > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> > >
> > > I just tried using cocoon://nav_bar.xsp but it still didn't work.
> > > Looking in the core.log I found the following message:
> > >
> > > DEBUG   (2002-07-11) 13:19.09:225
> > > [core.url-factory](/cocoon/index.xsp)
> > > Thread-6/URLFactoryImpl: Making URL from cocoon://nav_bar.xsp
> > > DEBUG   (2002-07-11) 13:19.09:225
> > > [core.url-factory](/cocoon/index.xsp)
> > > Thread-6/URLFactoryImpl: Making URL - MalformedURLException in
getURL:
> > > java.net.MalformedURLException: unknown protocol: cocoon
> > >  at java.net.URL.<init>(URL.java:586)
> > >  at java.net.URL.<init>(URL.java:476)
> > >  at java.net.URL.<init>(URL.java:425)
> > >  at org.apache.cocoon.components.url.URLFactoryImpl.getURL(
> > > URLFactoryImpl.java:118)
> > >  at org.apache.cocoon.www.logic.site_format_xsp.generate(
> >
> > Hmmm... Looks like util logicsheet's code is quite outdated... Would
you
> > mind patching util logicsheet (util.xsl)? It should use source
resolver
> > to do the work.
> >
> > If you don't know who to patch it, file a bug into bugzilla saying
that
> > util:include-uri uses URLFactory but should use source resolver.
> >
> >
> > Thanks,
> > Vadim
> >
> >
> > ...
> >
> > >  at java.lang.Thread.run(Thread.java:536)
> > >
> > > If anyone can make a suggestion it would be much appreciated.
> > > I'm using cocoon 2.0.2-dev, Tomcat 4.1.3b and JDK1.4.0
> > >
> > > -Eric Dalquist
> > >
> > >
> > > ----- Original Message -----
> > > From: "Vadim Gritsenko" <va...@verizon.net>
> > > To: <co...@xml.apache.org>
> > > Sent: Thursday, July 11, 2002 12:02 PM
> > > Subject: RE: [Q] util:include-uri relative path
> > >
> > > > > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> > > > >
> > > > > I'm wondering if I can use include-uri to include the 
> > > > > output of an XSP in
> > > > > another XSP. I can get it to work if I use the full path 
> > > > > but I don't want to
> > > > > do it this way unless I can use a relative path. The file is
> > > > > being included in
> > > > > site_format.xsp which is used as a style sheet for index.xsp
> > > > >
> > > > > Here is the working include:
> > > > > <util:include-uri
> > > > > href="http://www.incoherentramblings.net:8888
> > > > > /cocoon/nav_bar.xsp"/>
> > > > >
> > > > > I would like to do:
> > > > > <util:include-uri href="nav_bar.xsp"/>
> > > >
> > > > Why not:
> > > >
> > > > <util:include-uri href="cocoon://nav_bar.xsp"/>
> > > >
> > > > ?
> > > >
> > > > Vadim
...


---------------------------------------------------------------------
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: [Q] util:include-uri relative path

Posted by Eric Dalquist <eb...@mtu.edu>.
I'll look into patching it if you could give me a little more of a path to
follow ... like an example that uses the source revolver or API doc to look
at.

-Eric Dalquist

----- Original Message -----
From: "Vadim Gritsenko" <va...@verizon.net>
To: <co...@xml.apache.org>
Sent: Thursday, July 11, 2002 10:03 PM
Subject: RE: [Q] util:include-uri relative path


> > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> >
> > I just tried using cocoon://nav_bar.xsp but it still didn't work.
> Looking in
> > the core.log I found the following message:
> >
> > DEBUG   (2002-07-11) 13:19.09:225
> [core.url-factory](/cocoon/index.xsp)
> > Thread-6/URLFactoryImpl: Making URL from cocoon://nav_bar.xsp
> > DEBUG   (2002-07-11) 13:19.09:225
> [core.url-factory](/cocoon/index.xsp)
> > Thread-6/URLFactoryImpl: Making URL - MalformedURLException in getURL:
> > java.net.MalformedURLException: unknown protocol: cocoon
> >  at java.net.URL.<init>(URL.java:586)
> >  at java.net.URL.<init>(URL.java:476)
> >  at java.net.URL.<init>(URL.java:425)
> >  at
> >
> org.apache.cocoon.components.url.URLFactoryImpl.getURL(URLFactoryImpl.ja
> va:1
> > 18)
> >  at org.apache.cocoon.www.logic.site_format_xsp.generate(C:\Program
> > Files\Apache Group\Tomcat
>
> Hmmm... Looks like util logicsheet's code is quite outdated... Would you
> mind patching util logicsheet (util.xsl)? It should use source resolver
> to do the work.
>
> If you don't know who to patch it, file a bug into bugzilla saying that
> util:include-uri uses URLFactory but should use source resolver.
>
>
> Thanks,
> Vadim
>
>
> ...
>
> >  at java.lang.Thread.run(Thread.java:536)
> >
> > If anyone can make a suggestion it would be much appreciated.
> > I'm using cocoon 2.0.2-dev, Tomcat 4.1.3b and JDK1.4.0
> >
> > -Eric Dalquist
> >
> >
> > ----- Original Message -----
> > From: "Vadim Gritsenko" <va...@verizon.net>
> > To: <co...@xml.apache.org>
> > Sent: Thursday, July 11, 2002 12:02 PM
> > Subject: RE: [Q] util:include-uri relative path
> >
> >
> > > > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> > > >
> > > > I'm wondering if I can use include-uri to include the output of an
> XSP
> > > in
> > > > another XSP. I can get it to work if I use the full path but I
> don't
> > > want to
> > > > do it this way unless I can use a relative path. The file is being
> > > included
> > > > in site_format.xsp which is used as a style sheet for index.xsp
> > > >
> > > > Here is the working include:
> > > > <util:include-uri
> > > >
> href="http://www.incoherentramblings.net:8888/cocoon/nav_bar.xsp"/>
> > > >
> > > > I would like to do:
> > > > <util:include-uri href="nav_bar.xsp"/>
> > >
> > > Why not:
> > >
> > > <util:include-uri href="cocoon://nav_bar.xsp"/>
> > >
> > > ?
> > >
> > >
> > > Vadim
> > >
> > >
> ...
>
>
> ---------------------------------------------------------------------
> 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: [Q] util:include-uri relative path

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> 
> I just tried using cocoon://nav_bar.xsp but it still didn't work.
Looking in
> the core.log I found the following message:
> 
> DEBUG   (2002-07-11) 13:19.09:225
[core.url-factory](/cocoon/index.xsp)
> Thread-6/URLFactoryImpl: Making URL from cocoon://nav_bar.xsp
> DEBUG   (2002-07-11) 13:19.09:225
[core.url-factory](/cocoon/index.xsp)
> Thread-6/URLFactoryImpl: Making URL - MalformedURLException in getURL:
> java.net.MalformedURLException: unknown protocol: cocoon
>  at java.net.URL.<init>(URL.java:586)
>  at java.net.URL.<init>(URL.java:476)
>  at java.net.URL.<init>(URL.java:425)
>  at
>
org.apache.cocoon.components.url.URLFactoryImpl.getURL(URLFactoryImpl.ja
va:1
> 18)
>  at org.apache.cocoon.www.logic.site_format_xsp.generate(C:\Program
> Files\Apache Group\Tomcat

Hmmm... Looks like util logicsheet's code is quite outdated... Would you
mind patching util logicsheet (util.xsl)? It should use source resolver
to do the work.

If you don't know who to patch it, file a bug into bugzilla saying that
util:include-uri uses URLFactory but should use source resolver.


Thanks,
Vadim


...

>  at java.lang.Thread.run(Thread.java:536)
> 
> If anyone can make a suggestion it would be much appreciated.
> I'm using cocoon 2.0.2-dev, Tomcat 4.1.3b and JDK1.4.0
> 
> -Eric Dalquist
> 
> 
> ----- Original Message -----
> From: "Vadim Gritsenko" <va...@verizon.net>
> To: <co...@xml.apache.org>
> Sent: Thursday, July 11, 2002 12:02 PM
> Subject: RE: [Q] util:include-uri relative path
> 
> 
> > > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> > >
> > > I'm wondering if I can use include-uri to include the output of an
XSP
> > in
> > > another XSP. I can get it to work if I use the full path but I
don't
> > want to
> > > do it this way unless I can use a relative path. The file is being
> > included
> > > in site_format.xsp which is used as a style sheet for index.xsp
> > >
> > > Here is the working include:
> > > <util:include-uri
> > >
href="http://www.incoherentramblings.net:8888/cocoon/nav_bar.xsp"/>
> > >
> > > I would like to do:
> > > <util:include-uri href="nav_bar.xsp"/>
> >
> > Why not:
> >
> > <util:include-uri href="cocoon://nav_bar.xsp"/>
> >
> > ?
> >
> >
> > Vadim
> >
> >
...


---------------------------------------------------------------------
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: [Q] util:include-uri relative path

Posted by Eric Dalquist <eb...@mtu.edu>.
I just tried using cocoon://nav_bar.xsp but it still didn't work. Looking in
the core.log I found the following message:

DEBUG   (2002-07-11) 13:19.09:225   [core.url-factory](/cocoon/index.xsp)
Thread-6/URLFactoryImpl: Making URL from cocoon://nav_bar.xsp
DEBUG   (2002-07-11) 13:19.09:225   [core.url-factory](/cocoon/index.xsp)
Thread-6/URLFactoryImpl: Making URL - MalformedURLException in getURL:
java.net.MalformedURLException: unknown protocol: cocoon
 at java.net.URL.<init>(URL.java:586)
 at java.net.URL.<init>(URL.java:476)
 at java.net.URL.<init>(URL.java:425)
 at
org.apache.cocoon.components.url.URLFactoryImpl.getURL(URLFactoryImpl.java:1
18)
 at org.apache.cocoon.www.logic.site_format_xsp.generate(C:\Program
Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/logi
c\site_format_xsp.java:1051)
 at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenera
tor.java:260)
 at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv
entPipeline.java:251)
 at
org.apache.cocoon.components.source.SitemapSource.toSAX(SitemapSource.java:3
51)
 at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XS
LTProcessorImpl.java:233)
 at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XS
LTProcessorImpl.java:204)
 at
org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:
295)
 at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(Ab
stractEventPipeline.java:215)
 at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEven
tPipeline.java:279)
 at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(Cachi
ngEventPipeline.java:142)
 at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
treamPipeline.java:320)
 at org.apache.cocoon.www.sitemap_xmap.matchN4002E2(C:\Program Files\Apache
Group\Tomcat
4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www\site
map_xmap.java:2525)
 at org.apache.cocoon.www.sitemap_xmap.process(C:\Program Files\Apache
Group\Tomcat
4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www\site
map_xmap.java:2121)
 at org.apache.cocoon.www.sitemap_xmap.process(C:\Program Files\Apache
Group\Tomcat
4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www\site
map_xmap.java:2021)
 at org.apache.cocoon.sitemap.Handler.process(Handler.java:222)
 at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
 at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)
 at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
 at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:998)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:646)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:646)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2349)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:646)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:644)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:644)
 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:644)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:646)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:376)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:518)
 at java.lang.Thread.run(Thread.java:536)

If anyone can make a suggestion it would be much appreciated.
I'm using cocoon 2.0.2-dev, Tomcat 4.1.3b and JDK1.4.0

-Eric Dalquist


----- Original Message -----
From: "Vadim Gritsenko" <va...@verizon.net>
To: <co...@xml.apache.org>
Sent: Thursday, July 11, 2002 12:02 PM
Subject: RE: [Q] util:include-uri relative path


> > From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> >
> > I'm wondering if I can use include-uri to include the output of an XSP
> in
> > another XSP. I can get it to work if I use the full path but I don't
> want to
> > do it this way unless I can use a relative path. The file is being
> included
> > in site_format.xsp which is used as a style sheet for index.xsp
> >
> > Here is the working include:
> > <util:include-uri
> > href="http://www.incoherentramblings.net:8888/cocoon/nav_bar.xsp"/>
> >
> > I would like to do:
> > <util:include-uri href="nav_bar.xsp"/>
>
> Why not:
>
> <util:include-uri href="cocoon://nav_bar.xsp"/>
>
> ?
>
>
> Vadim
>
>
>
> > Here is my dir structure:
> > <TOMCAT_HOME>/
> >     webapps/
> >         cocoon/
> >             sitemap.xmap
> >             logic/
> >                 site_format.xsp
> >                 nav_bar.xsp
> >                 index.xsp
> >             stylesheets/
> >                 nav_bar.xsl
> >                 index.xsl
> >
> >
> > Here is an experpt from my sitemap:
> >
> >
> >             <!--
> >              | This is the ONLY special style sheet in the site. It is
> > generate so that
> >              | the nav bar, which is constant on all pages, can be
> dynamic.
> >              -->
> >             <map:match pattern="site_format.xsl">
> >                 <map:generate type="serverpages"
> > src="logic/site_format.xsp"/>
> >                 <map:serialize type="xml"/>
> >             </map:match>
> >             <!--
> >              | The navbar generator. We don't want to run the
> site_format on
> > this.
> >              -->
> >             <map:match pattern="nav_bar.xsp">
> >                 <map:generate type="serverpages"
> src="logic/nav_bar.xsp"/>
> >                 <map:transform src="stylesheets/nav_bar.xsl"/>
> >                 <map:serialize type="xml"/>
> >             </map:match>
> >
> >             <!--
> >              | Generate any .xsp file. We apply it's style sheet and
> then
> > the
> >              | main site stylesheet.
> >              -->
> >             <map:match pattern="*.xsp">
> >                 <map:generate type="serverpages" src="logic/{1}.xsp"/>
> >                 <map:transform src="cocoon:/site_format.xsl"/>
> >                 <map:transform src="stylesheets/{1}.xsl"/>
> >                 <map:serialize/>
> >             </map:match>
>
>
> ---------------------------------------------------------------------
> 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: [Q] util:include-uri relative path

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> 
> I'm wondering if I can use include-uri to include the output of an XSP
in
> another XSP. I can get it to work if I use the full path but I don't
want to
> do it this way unless I can use a relative path. The file is being
included
> in site_format.xsp which is used as a style sheet for index.xsp
> 
> Here is the working include:
> <util:include-uri
> href="http://www.incoherentramblings.net:8888/cocoon/nav_bar.xsp"/>
> 
> I would like to do:
> <util:include-uri href="nav_bar.xsp"/>

Why not:

<util:include-uri href="cocoon://nav_bar.xsp"/>

?


Vadim



> Here is my dir structure:
> <TOMCAT_HOME>/
>     webapps/
>         cocoon/
>             sitemap.xmap
>             logic/
>                 site_format.xsp
>                 nav_bar.xsp
>                 index.xsp
>             stylesheets/
>                 nav_bar.xsl
>                 index.xsl
> 
> 
> Here is an experpt from my sitemap:
> 
> 
>             <!--
>              | This is the ONLY special style sheet in the site. It is
> generate so that
>              | the nav bar, which is constant on all pages, can be
dynamic.
>              -->
>             <map:match pattern="site_format.xsl">
>                 <map:generate type="serverpages"
> src="logic/site_format.xsp"/>
>                 <map:serialize type="xml"/>
>             </map:match>
>             <!--
>              | The navbar generator. We don't want to run the
site_format on
> this.
>              -->
>             <map:match pattern="nav_bar.xsp">
>                 <map:generate type="serverpages"
src="logic/nav_bar.xsp"/>
>                 <map:transform src="stylesheets/nav_bar.xsl"/>
>                 <map:serialize type="xml"/>
>             </map:match>
> 
>             <!--
>              | Generate any .xsp file. We apply it's style sheet and
then
> the
>              | main site stylesheet.
>              -->
>             <map:match pattern="*.xsp">
>                 <map:generate type="serverpages" src="logic/{1}.xsp"/>
>                 <map:transform src="cocoon:/site_format.xsl"/>
>                 <map:transform src="stylesheets/{1}.xsl"/>
>                 <map:serialize/>
>             </map:match>


---------------------------------------------------------------------
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>