You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2005/01/06 01:02:23 UTC

context: protocol not available?

Hi,

I have some stylesheets containing:

    <xsl:import href="context:/path/to/something.xslt" />

In 2.1.6, this causes:

    java.net.MalformedURLException: unknown protocol: context
        at java.net.URL.<init>(URL.java:544)
        at java.net.URL.<init>(URL.java:434)
        at java.net.URL.<init>(URL.java:383)
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)

It worked fine in 2.1.5!  Any idea what's going on?

Thanks,
Mark

RE: context: protocol not available?

Posted by Mark Lundquist <ml...@wrinkledog.com>.
Hi Lars,

I think this discussion is going to have to move to the dev list...
following up there presently
:-)

~ml


> -----Original Message-----
> From: Lars Huttar [mailto:lars_huttar@sil.org]
> Sent: Thursday, January 06, 2005 8:33 AM
> To: users@cocoon.apache.org
> Subject: Re: context: protocol not available?
>
>
> Mark Lundquist wrote:
>
> > Hi,
> >
> > I have some stylesheets containing:
> >
> >     <xsl:import href="context:/path/to/something.xslt" />
> >
> > In 2.1.6, this causes:
> >
> >     java.net.MalformedURLException: unknown protocol: context
> >         at java.net.URL.<init>(URL.java:544)
> >         at java.net.URL.<init>(URL.java:434)
> >         at java.net.URL.<init>(URL.java:383)
> >         at
> >
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
> >
> > It worked fine in 2.1.5!  Any idea what's going on?
> >
> > Thanks,
> > Mark
> >
>
> I don't know why it worked in 2.1.5, but I do know that "context:" is a
> pseudoprotocol understood only by Cocoon. In particular it isn't
> understood by an XSLT processor (unless Xalan can somehow get help from
> Cocoon's URI resolver?)
> I have tried using "context:" in stylesheets under Cocoon 2.1.2 and got
> the same error you did, so had to work around it.
>
> I would appreciate hearing from someone more knowledgeable about this
> though. If there was a way to do it, it would be nice, although it would
> make the stylesheet less portable.
>
> Lars
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: context: protocol not available?

Posted by Mark Lundquist <ml...@wrinkledog.com>.

> From: Mark Lundquist [mailto:ml@wrinkledog.com]
>
> [..snip..]
>
> Yes, this absolutely is supposed to work! :-)
>
> org.apache.xalan.processor.TransformerFactoryImpl implements
> javax.xml.transform.TransformerFactory, which provides the
> setURIResolver()
> method.
>
> And we want that to be... uh, o.a.c.components.CocoonComponentManager?  Or
> whatever Cocoon's SourceResolver is.  Excalibur actually wires it up, I
> guess.
>
> Cocoon 2.1.6 uses the same Excalibur release as 2.1.5...
>
> I'm so confuzzled...

OK, so I was faked out by some delegation... but in the end it looks like it
turns out to be the straight-up Excalibur resolver
(oa.excalibur.source.impl.SourceResolverImpl, specified in cocoon.roles),
and that implements the SourceFactory scheme Cocoon uses for extending the
protocol space.

Am I understanding this correctly?

Anyway, I haven't figured out why it no work in 2.1.6... :-(  Apparently,
somehow this resolver isn't getting passed to
oa.xalan.processor.TransformerFactoryImpl.setURIResolver().

:-(

~ml




RE: context: protocol not available?

Posted by Mark Lundquist <ml...@wrinkledog.com>.
Hi Lars & everyone,

> From: Lars Huttar [mailto:lars_huttar@sil.org]
>
> Mark Lundquist wrote (on users@cocoon.apache.org):
>
> > Hi,
> >
> > I have some stylesheets containing:
> >
> >     <xsl:import href="context:/path/to/something.xslt" />
> >
> > In 2.1.6, this causes:
> >
> >     java.net.MalformedURLException: unknown protocol: context
> >         at java.net.URL.<init>(URL.java:544)
> >         at java.net.URL.<init>(URL.java:434)
> >         at java.net.URL.<init>(URL.java:383)
> >         at
> >
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
> >
> > It worked fine in 2.1.5!  Any idea what's going on?
> >
> > Thanks,
> > Mark
> >
>
> I don't know why it worked in 2.1.5, but I do know that "context:" is a
> pseudoprotocol understood only by Cocoon. In particular it isn't
> understood by an XSLT processor (unless Xalan can somehow get help from
> Cocoon's URI resolver?)

Yes, this absolutely is supposed to work! :-)

org.apache.xalan.processor.TransformerFactoryImpl implements
javax.xml.transform.TransformerFactory, which provides the setURIResolver()
method.

And we want that to be... uh, o.a.c.components.CocoonComponentManager?  Or
whatever Cocoon's SourceResolver is.  Excalibur actually wires it up, I
guess.

Cocoon 2.1.6 uses the same Excalibur release as 2.1.5...

I'm so confuzzled...

~ml



Re: context: protocol not available?

Posted by Lars Huttar <la...@sil.org>.
Mark Lundquist wrote:

> Hi,
>  
> I have some stylesheets containing:
>  
>     <xsl:import href="context:/path/to/something.xslt" />
>  
> In 2.1.6, this causes:
>  
>     java.net.MalformedURLException: unknown protocol: context
>         at java.net.URL.<init>(URL.java:544)
>         at java.net.URL.<init>(URL.java:434)
>         at java.net.URL.<init>(URL.java:383)
>         at 
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
>        
> It worked fine in 2.1.5!  Any idea what's going on?
>  
> Thanks,
> Mark
>  

I don't know why it worked in 2.1.5, but I do know that "context:" is a 
pseudoprotocol understood only by Cocoon. In particular it isn't 
understood by an XSLT processor (unless Xalan can somehow get help from 
Cocoon's URI resolver?)
I have tried using "context:" in stylesheets under Cocoon 2.1.2 and got 
the same error you did, so had to work around it.

I would appreciate hearing from someone more knowledgeable about this 
though. If there was a way to do it, it would be nice, although it would 
make the stylesheet less portable.

Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org