[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Upgrading version should lead to bug - right?
On 13/09/2012 08:16, Ihe Onwuka wrote:
No, it's entirely possible that it will happen. Once you set the version attribute to 2.0, you enable XSLT 2.0's stronger type checking. For example, in XSLT 1.0, contains(author, "abc") works fine if there is more than one author (it just takes the first, and ignores the others), while XSLT 2.0 gives you the type error that you are reporting.I have an XSLT 1.0 stylesheet that has been running on an XSLT 2.0 processor no problem but barfs when you upgrade the version attribute (no other change to the code) to 2.0. If the stylesheet author's intent was to select the first item and ignore the others (a common example is contains(following-sibling::*, "xyz")) then the fix is to make this explicit: change it to contains(following-sibling::*[1], "xyz"). But sometimes, when you look at the code, you realize that the stylesheet author simply didn't take into account the possibility that the expression might select more than one node. No, your first argument to contains() has selected more than one string. The first string is "_IOS, _WEB, _CTV", the second string is exactly the same, and subsequent strings (if they exist) are not listed in the error message. Michael Kay Saxonica
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|