Title: Message
I have a rather lengthy template rule to selectively copy stylistic attributes. However, when I use this template rule, a java.lang.ArrayIndexOutOfBoundsException is thrown. I'm guess this is a bug because when I remove the template, the stylesheet runs and the full version will run under MSXML. As a side note, if anyone has any suggestions how to optimize this kind of operation within the scope of the stylesheet, I'd be appreciative as I will doing several similar operations in other stylesheets.
 
Thanks
 
John
 
<xsl:template match="@source-document |
        @role |
        @absolute-position |
        @top |
        @right |
        @bottom |
        @left |
        @azimuth |
        ... about 200 other attributes here
        @white-space |
        @xml:lang" mode="copy-style-attrs">
    <xsl:copy-of select="."/>
</xsl:template>
 
 <xsl:template match="@*" mode="copy-style-attrs"/>
 
 
 
java.lang.ArrayIndexOutOfBoundsException
 at org.apache.xpath.compiler.Lexer.mapPatternElemPos(Lexer.java:436)
 at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:252)
 at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:139)
 at org.apache.xpath.compiler.XPathParser.initMatchPattern(XPathParser.java:194)
 at org.apache.xpath.XPath.<init>(XPath.java:200)
 at org.apache.xalan.processor.StylesheetHandler.createMatchPatternXPath(StylesheetHandler.java:210)
 at org.apache.xalan.processor.XSLTAttributeDef.processPATTERN(XSLTAttributeDef.java:625)
 at org.apache.xalan.processor.XSLTAttributeDef.processValue(XSLTAttributeDef.java:923)
 at org.apache.xalan.processor.XSLTAttributeDef.setAttrValue(XSLTAttributeDef.java:1075)
 at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:364)
 at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:300)
 at org.apache.xalan.processor.ProcessorTemplateElem.startElement(ProcessorTemplateElem.java:120)
 at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:632)
 at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
 at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1214)
 at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
 at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1182)
 at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
 at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:795)

Reply via email to