[ http://issues.apache.org/jira/browse/XALANJ-1263?page=comments#action_60873 ] Brian Minchau commented on XALANJ-1263: ---------------------------------------
Here is a much simpler stylesheet displaying this cast exception: -------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:variable name="my_rtf"> <rec>ABC</rec><rec>DEF</rec> </xsl:variable> <!-- can not use RTF in XPath expression --> <out><xsl:value-of select="sum($my_rtf/rec)"/></out> </xsl:template> </xsl:stylesheet> --------------------------------------- The class cast exception happens in class org.apache.xpath.axes.FilterExprIteratorSimple Method: executeFilterExpr(...) On this line: result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); > RTF where nodeset expected: better message desired > -------------------------------------------------- > > Key: XALANJ-1263 > URL: http://issues.apache.org/jira/browse/XALANJ-1263 > Project: XalanJ2 > Type: Bug > Components: Xalan > Versions: 2.4 > Environment: Operating System: MacOS X > Platform: Macintosh > Reporter: Ron Newman > Assignee: Morris Kwan > Priority: Minor > Attachments: congress6.xsl > > If you run > java org.apache.xalan.xslt.Process -in > http://xml.house.gov/Members/mbr107.xml -xsl > congress6.xsl > you die with this error: > file:///Users/rnewman/xml/2/congress6.xsl; Line #22; Column #43; XSLT Error > (javax.xml.transform.TransformerException): java.lang.ClassCastException: > org.apache.xpath.objects.XRTreeFrag > Here are the contents of congress6.xsl: > <?xml version="1.0" encoding="utf-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:xalan="http://xml.apache.org/xalan" > version="1.1"> > <xsl:output method="html" > doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" > doctype-system="http://www.w3.org/TR/html4/strict.dtd" > indent="yes"/> > > <xsl:template name="title"> > <xsl:value-of select="metadata/congress"/>, <xsl:value-of > select="metadata/date"/> > </xsl:template> > > <xsl:template name="state-list"> > <xsl:variable name="list"> > <xsl:for-each select="member"> > <xsl:sort select="state"/> > <xsl:copy-of select="state"/> > </xsl:for-each> > </xsl:variable> > <xsl:for-each select="($list)/state"> > <xsl:if test="not(.=preceding-sibling::state[1])"> > <xsl:copy-of select="."/> > </xsl:if> > </xsl:for-each> > </xsl:template> > > > <xsl:template match="/ushousemembers"> > <html> > <head> > <title><xsl:call-template name="title"/></title> > <link href="http://cscie153.dce.harvard.edu/css/congress.css" > type="text/css" rel="stylesheet"/> > </head> > <body> > <h1><xsl:call-template name="title"/></h1> > <xsl:call-template name="state-list"/> > <hr/> > </body> > </html> > </xsl:template> > </xsl:stylesheet> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
