Re: ArrayIndexOutOfBoundsException when using copy-of to write into a new node

2003-06-20 Thread Lionel Crine
hi,
there is an error :
use
  xsl:copy-of select=document(concat('../xmldocs/', string($document)))/*/
instead of
  xsl:copy-of select=document(concat('../xmldocs/', tring($document)))/*/
Also, $document is an xsl:param ?

About the error I don't know.
try to send this to the mulberrytech [EMAIL PROTECTED].
Lionel

At 17:12 19/06/2003 +0200, you wrote:
hi!

I'm creating a website using the following software:
Tomcat:4.1.24
Cocoon: version 2.0.5-dev
Xalan: 2.5.1
Xerces: 2.4.0
What I'd like to do is the following:
Create a new tag in the result tree and copy a part of another xml-file in 
there.
Just like this:

  xsl:template match=content_element
 abcdef
xsl:copy-of select=document(concat('../xmldocs/', 
tring($document)))/*/
 /abcdef
  /xsl:template

This gives the following error which seems strange to me.

ERROR MESSAGE-

The org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode 
notifies that org.apache.cocoon.ProcessingException says:

Exception during processing of 
file:/C:/Progra~1/jakarta-tomcat-4.1.24/webapps/cocoon/docs/educeth/commondocs/structure.xml

More precisely:

org.apache.cocoon.ProcessingException: Exception during processing of 
file:/C:/Progra~1/jakarta-omcat-4.1.24/webapps/cocoon/docs/educeth/commondocs/structure.xml: 
java.lang.RuntimeException: Errors in XSLT transformation:
Fatal: File 
file:/C:/Progra~1/jakarta-tomcat-4.1.24/webapps/cocoon/docs/educeth/stylesheets/assembly.xsl; 
Line 59; Column 81; java.lang.ArrayIndexOutOfBoundsException: -1

-END OF ERROR MESSAGE-

I get the same error if I use

  xsl:template match=content_element
 xsl:element name=abcdef
 xsl:copy-of select=document(concat('../xmldocs/', 
string($document)))/*/
 xsl:element/
  /xsl:template



Every other tag than xsl:copy of.../ works as it should.

Below, I have attached the complete exception trace.

I would be very glad if someone could help me!
Thanks in advance!
Stefan
Original exception : java.lang.RuntimeException: Errors in XSLT 
transformation:
Fatal: File 
file:/C:/Progra~1/jakarta-tomcat-4.1.24/webapps/cocoon/docs/educeth/stylesheets/assembly.xsl; 
Line 59; Column 81; java.lang.ArrayIndexOutOfBoundsException: -1

at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3364)
at 
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:427)
at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:91)
at 
org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:589)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:302)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:321)
at 
org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStreamSource.java:197)
at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:143)
at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:258)
at 
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:412)
at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:148)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:151)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:145)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:340)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:301)
at 

ArrayIndexOutOfBoundsException when using copy-of to write into a new node

2003-06-19 Thread Stefan Hilzinger
hi!

I'm creating a website using the following software:
Tomcat:4.1.24
Cocoon: version 2.0.5-dev
Xalan: 2.5.1
Xerces: 2.4.0
What I'd like to do is the following:
Create a new tag in the result tree and copy a part of another xml-file in 
there.
Just like this:

  xsl:template match=content_element
 abcdef
xsl:copy-of select=document(concat('../xmldocs/', 
tring($document)))/*/
 /abcdef
  /xsl:template

This gives the following error which seems strange to me.

ERROR MESSAGE-

The org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode notifies 
that org.apache.cocoon.ProcessingException says:

Exception during processing of 
file:/C:/Progra~1/jakarta-tomcat-4.1.24/webapps/cocoon/docs/educeth/commondocs/structure.xml

More precisely:

org.apache.cocoon.ProcessingException: Exception during processing of 
file:/C:/Progra~1/jakarta-omcat-4.1.24/webapps/cocoon/docs/educeth/commondocs/structure.xml: 
java.lang.RuntimeException: Errors in XSLT transformation:
Fatal: File 
file:/C:/Progra~1/jakarta-tomcat-4.1.24/webapps/cocoon/docs/educeth/stylesheets/assembly.xsl; 
Line 59; Column 81; java.lang.ArrayIndexOutOfBoundsException: -1

-END OF ERROR MESSAGE-

I get the same error if I use

  xsl:template match=content_element
 xsl:element name=abcdef
 xsl:copy-of select=document(concat('../xmldocs/', 
string($document)))/*/
 xsl:element/
  /xsl:template



Every other tag than xsl:copy of.../ works as it should.

Below, I have attached the complete exception trace.

I would be very glad if someone could help me!
Thanks in advance!
Stefan
Original exception : java.lang.RuntimeException: Errors in XSLT 
transformation:
Fatal: File 
file:/C:/Progra~1/jakarta-tomcat-4.1.24/webapps/cocoon/docs/educeth/stylesheets/assembly.xsl; 
Line 59; Column 81; java.lang.ArrayIndexOutOfBoundsException: -1

at 
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3364)
at 
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:427)
at 
org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:91)
at 
org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:589)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:302)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:321)
at 
org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStreamSource.java:197)
at 
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:143)
at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:258)
at 
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:412)
at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:148)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:151)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:145)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:340)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:301)
at org.apache.cocoon.Cocoon.process(Cocoon.java:581)
at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1048)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at