You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Michael Engelhart <me...@earthtrip.com> on 2000/01/18 22:30:26 UTC

1.6 problems

Can anyone shed some light on this problem for me?  Are my PI's invalid or
something?

This gets thrown when accessing a document that worked fine in 1.5.

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(Compiled Code)
    at org.apache.cocoon.Utils.getPIPseudoAttributes(Compiled Code)
    at 
org.apache.cocoon.formatter.FormatterFactory.getType(FormatterFactory.java:8
2)
    at 
org.apache.cocoon.formatter.FormatterFactory.getFormatter(FormatterFactory.j
ava:70)
    at org.apache.cocoon.Engine.handle(Compiled Code)
    at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at 
org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:6
26)
    at org.apache.tomcat.core.ServletWrapper.handleInvocation(Compiled Code)
    at 
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
    at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
    at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
    at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:144)
    at 
org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:304)
    at java.lang.Thread.run(Thread.java)




Re: 1.6 problems

Posted by Steve Muench <sm...@us.oracle.com>.
I've had trouble with some PI pseudo-attribute
tokenizers (maybe Cocoon does this, too) which
expect pseudo-attrs to have either Single or
Double quotes but don't account for both
cases.

<?pi x="y" z='q'?>

Maybe this is a place to start looking given
the kind of String Index error...

_________________________________________________________
Steve Muench, Consulting Product Manager & XML Evangelist
Business Components for Java Development Team

----- Original Message -----
From: "Michael Engelhart" <me...@earthtrip.com>
To: "Cocoon Dev" <co...@xml.apache.org>
Sent: Tuesday, January 18, 2000 1:30 PM
Subject: 1.6 problems


| Can anyone shed some light on this problem for me?  Are my PI's invalid or
| something?
|
| This gets thrown when accessing a document that worked fine in 1.5.
|
| java.lang.StringIndexOutOfBoundsException: String index out of range: -1
|     at java.lang.String.substring(Compiled Code)
|     at org.apache.cocoon.Utils.getPIPseudoAttributes(Compiled Code)
|     at
|
org.apache.cocoon.formatter.FormatterFactory.getType(FormatterFactory.java:8
| 2)
|     at
|
org.apache.cocoon.formatter.FormatterFactory.getFormatter(FormatterFactory.j
| ava:70)
|     at org.apache.cocoon.Engine.handle(Compiled Code)
|     at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
|     at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
|     at
|
org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:6
| 26)
|     at org.apache.tomcat.core.ServletWrapper.handleInvocation(Compiled
Code)
|     at
|
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
|     at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
|     at
| org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
|     at
|
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
| onnectionHandler.java:144)
|     at
| org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:304)
|     at java.lang.Thread.run(Thread.java)
|
|
|
|


Re: 1.6 problems

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 18 Jan 2000, Michael Engelhart wrote:

>  
> > You don't need cocoon-format unless you want something besides text/html.
> > 
> > Also, be aware that the official namespace for XSLT is now
> > 
> > http://www.w3.org/1999/XSL/Transform
> > 
> > don't ask me why, _I_ think having the year as the version indicator
> > inside the namespace is pretty stupid, but what do I know?
> 
> Thanks - I wasn't aware of the namespace change.  I agree - the year as
> version indicator is pretty weak.

Actually, I must correct myself. From the XSLT document:

NOTE: The 1999 in the URI indicates the year in which the URI was
allocated by the W3C. It does not indicate the version of XSLT being used,
which is specified by attributes (see [2.2 Stylesheet Element] and [2.3
Literal Result Element as Stylesheet]).

- donald


Re: 1.6 problems

Posted by Michael Engelhart <me...@earthtrip.com>.
 
> You don't need cocoon-format unless you want something besides text/html.
> 
> Also, be aware that the official namespace for XSLT is now
> 
> http://www.w3.org/1999/XSL/Transform
> 
> don't ask me why, _I_ think having the year as the version indicator
> inside the namespace is pretty stupid, but what do I know?

Thanks - I wasn't aware of the namespace change.  I agree - the year as
version indicator is pretty weak.

Mike


Re: 1.6 problems

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 18 Jan 2000, Michael Engelhart wrote:

> on 1/18/00 3:39 PM, Donald Ball at balld@webslingerZ.com wrote:
> 
> > post up your XML and XSLT pages and we'll have a look see. I ran into this
> > myself with 1.6dev but can't recall offhand what the problem was.
> > 
> > - donald
> 
> I think I found it.   From the examples in 1.5 I had this at the top of my
> XSL:
> 
> <?xml version="1.0"?>
> <xsl:processing-instruction name="cocoon-format">
>     type="text/html"
> </xsl:processing-instruction>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
>     <xsl:template match="DOCUMENT">
> 
> .....SNIP....
> 
> My original XSL page had the PI inside of the <xsl:template
> match="DOCUMENT"> which apparently is malformed but the 1.5 system allowed
> it.  So i moved it above the <xsl:stylesheet> tag and then I started getting
> StringTokenizer errors.
> Removing the PI altogether fixed it and now my pages work so far. Do I need
> the "cocoon-format" instruction anymore?  It appears that I don't but I'm
> not sure what it was there for in the first place.

You don't need cocoon-format unless you want something besides text/html.

Also, be aware that the official namespace for XSLT is now

http://www.w3.org/1999/XSL/Transform

don't ask me why, _I_ think having the year as the version indicator 
inside the namespace is pretty stupid, but what do I know?

- donald


Re: 1.6 problems

Posted by Michael Engelhart <me...@earthtrip.com>.
on 1/18/00 3:39 PM, Donald Ball at balld@webslingerZ.com wrote:

> post up your XML and XSLT pages and we'll have a look see. I ran into this
> myself with 1.6dev but can't recall offhand what the problem was.
> 
> - donald

I think I found it.   From the examples in 1.5 I had this at the top of my
XSL:

<?xml version="1.0"?>
<xsl:processing-instruction name="cocoon-format">
    type="text/html"
</xsl:processing-instruction>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
    <xsl:template match="DOCUMENT">

.....SNIP....

My original XSL page had the PI inside of the <xsl:template
match="DOCUMENT"> which apparently is malformed but the 1.5 system allowed
it.  So i moved it above the <xsl:stylesheet> tag and then I started getting
StringTokenizer errors.
Removing the PI altogether fixed it and now my pages work so far. Do I need
the "cocoon-format" instruction anymore?  It appears that I don't but I'm
not sure what it was there for in the first place.

Mike


Re: 1.6 problems

Posted by Donald Ball <ba...@webslingerZ.com>.
post up your XML and XSLT pages and we'll have a look see. I ran into this
myself with 1.6dev but can't recall offhand what the problem was.

- donald

On Tue, 18 Jan 2000, Michael Engelhart wrote:

> Can anyone shed some light on this problem for me?  Are my PI's invalid or
> something?
> 
> This gets thrown when accessing a document that worked fine in 1.5.
> 
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>     at java.lang.String.substring(Compiled Code)
>     at org.apache.cocoon.Utils.getPIPseudoAttributes(Compiled Code)
>     at 
> org.apache.cocoon.formatter.FormatterFactory.getType(FormatterFactory.java:8
> 2)
>     at 
> org.apache.cocoon.formatter.FormatterFactory.getFormatter(FormatterFactory.j
> ava:70)
>     at org.apache.cocoon.Engine.handle(Compiled Code)
>     at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
>     at 
> org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:6
> 26)
>     at org.apache.tomcat.core.ServletWrapper.handleInvocation(Compiled Code)
>     at 
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
>     at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
>     at 
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
>     at 
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:144)
>     at 
> org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:304)
>     at java.lang.Thread.run(Thread.java)
> 
> 
>