J
Johannes Lebek
Hi there,
I made some changes to my XSL stylesheet and now Xalan 2.5.1 is facing
ClassCastExceptions. I'm pretty sure, that the changes I made should work
(they are quite complicated -- I'd like to not explain them here).
My question is, is a ClassCastException a usual response in case of an error
in a stylesheet or is this a bug? I thought, Xalan would handle exceptions
like this internally.
This is the error message I get:
file:///D:/XSLT/stylesheet.xsl; Line #558; Column #137; XSLT Error
(javax.xml.transform.TransformerException): java.lang.ClassCastExc
eption: org.apache.xpath.objects.XString
Line 558:
<xsl:value-of select="generate-id(//a[@b = $c/@d])"/>
Variable 'c' was defined just two lines above:
<xsl:value-of select="//e[@f = current()/parent::e/@h]"/>
Value of variable 'c' is always a single node. Even if I changed the
assignment to
<xsl:value-of select="//e[@f = current()/parent::e/@h][1]"/>
it did not help. (Please, note '[1]' at the end of the predicate!)
Usually, the error messages I got were something like "this or that is not
allowed" or "character ']' expected, but ')' found" or stuff like that. The
error message I got now is kinda "naked", like unhandled.
What do you think?
Johannes
I made some changes to my XSL stylesheet and now Xalan 2.5.1 is facing
ClassCastExceptions. I'm pretty sure, that the changes I made should work
(they are quite complicated -- I'd like to not explain them here).
My question is, is a ClassCastException a usual response in case of an error
in a stylesheet or is this a bug? I thought, Xalan would handle exceptions
like this internally.
This is the error message I get:
file:///D:/XSLT/stylesheet.xsl; Line #558; Column #137; XSLT Error
(javax.xml.transform.TransformerException): java.lang.ClassCastExc
eption: org.apache.xpath.objects.XString
Line 558:
<xsl:value-of select="generate-id(//a[@b = $c/@d])"/>
Variable 'c' was defined just two lines above:
<xsl:value-of select="//e[@f = current()/parent::e/@h]"/>
Value of variable 'c' is always a single node. Even if I changed the
assignment to
<xsl:value-of select="//e[@f = current()/parent::e/@h][1]"/>
it did not help. (Please, note '[1]' at the end of the predicate!)
Usually, the error messages I got were something like "this or that is not
allowed" or "character ']' expected, but ')' found" or stuff like that. The
error message I got now is kinda "naked", like unhandled.
What do you think?
Johannes