Subject:2 copies of stylus behaving differently ? XSLT 2.0 Author:simon mclean Date:18 Jan 2007 08:59 AM
Hi - I've built a style sheet that runs perfectly on stylus on my PC. When a colleague opens it in stylus on their PC it doesn't work. The sheet is XSLT 2.0 and we are both using Saxon 8.7.3.
However, if my colleague puts xpath-default-namespace=... in the opening <xsl:stylsheet> element then the stylsheet works on thier PC, but not on mine!!
Subject:2 copies of stylus behaving differently ? XSLT 2.0 Author:simon mclean Date:19 Jan 2007 03:09 AM Originally Posted: 19 Jan 2007 02:56 AM
I've attached the XSLT (slight changes to previous, but same strange behaviour), plus the source and target XML doc. To recap: The attched will NOT run on my stylus studio using Saxon 8.7.3, but it will run on my colleagues stylus studio.
Subject:2 copies of stylus behaving differently ? XSLT 2.0 Author:(Deleted User) Date:19 Jan 2007 04:15 AM
Hi Simon,
the XSLT stylesheet specifies xpath-default-namespace="http://www.opentravel.org/OTA/2003/05/beta" that defines a default namespace for every XPath query, but your XML document doesn't place any element in that namespace.
So I guess that one of you two has a source XML file having an xmlns="http://www.opentravel.org/OTA/2003/05/beta" attribute on the root OTA_HotelAvailRS element.
Subject:2 copies of stylus behaving differently ? XSLT 2.0 Author:simon mclean Date:19 Jan 2007 10:59 AM
Hi Alberto -
I am sure you are correct, but we definitely have one copy of stylus that is taking the sources attached to my post and processing them succesfully (which is, as you suggest, actually incorrect because the source xml doesn't have any elements in the declared default namespace). Strange.
We've decided not to use the xpath-default-namespace attribute now, and instead specify prefixes right the way through. Feels a bit safer being explicit.