#107 Conflicts in xsl:strip-space

v7.3
closed
5
2012-10-08
2002-11-21
Michael Kay
No

XSLT 1.0 (see erratum 30) says that it is a recoverable
error to have two xsl:strip-space or xsl:preserve-space
declarations that match the same element. Previous
releases of Saxon took the recovery action: no error
was reported. Saxon 7.3 detects the error, and falls
over with a NullPointerException trying to report it.
Further, if Crimson is being used as the XML parser,
this NullPointerException is not actually reported,
because of bug 941940. All that happens is the single
line message "Transformation failed - run-time errors
were reported".

The NullPointerException occurs in method
reportAmbiguity of class net.sf.saxon.trans.Mode, while
trying to call Navigator.getPath. This doesn't work
because the element node used for strip-space testing
is a dummy node, and doesn't support all the properties
of a real node. Also, the patterns used for strip-space
testing have no location information, so the line
number and system ID are wrong.

Previous releases avoided the problem as an accidental
consequence of the fact that no ambiguity was reported
in the case of two patterns having the same line number
(which was taken to mean that they were probably
components of a union pattern in the same template rule).

Discussion

  • Michael Kay

    Michael Kay - 2002-11-21

    Logged In: YES
    user_id=251681

    Source code fixed.

    Test case added: whte19

     
  • Michael Kay

    Michael Kay - 2002-12-10

    Logged In: YES
    user_id=251681

    Fixed in 7.3.1

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks