Actions
Bug #2020
closedLine number failing to show in error message
Start date:
2014-03-05
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Description
In the following simple stylesheet which should report the error 'FOTY0012: Cannot get the typed value of an element with element-only content' the line number of where the error occurs fails to show up:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="/books/book/authors"/>
</xsl:template>
</xsl:stylesheet>
The failure is on line 3. <xsl:value-of select="/books/book/authors"/>
In the schema we have:
<xs:element name="authors">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="author"/>
</xs:sequence>
</xs:complexType>
</xs:element>
which defines element only content type.
The fix: We catch the exception and provide location information where possible. This has been applied in the method process and iterate of CompiledExpression class. We also do the same in the interpreted code in the processLeavingTail method of the SimpleNodeConstructor class.
Please register to edit this issue
Actions