Spent an hour this morning (with a client) tracking down an elusive bug in a stylesheet. As described in my Stylus Studio article, it was one of those classic problems where a path expression or match pattern selects nothing: and if the stylesheet had been schema-aware we would have found the problem in no time. So why wasn't it? Answer: because it was cobbled together quickly, and it was the second transformation in a pipeline, and the intermediate format was ad-hoc and local. But we could have generated a schema from the instance document after running the first step in the pipeline. Resolution: I must learn to take my own medicine.
|
|
||||||||
Thoughts on schema-awareness
Comments
Re: Thoughts on schema-awareness
by
Dimitre Novatchev
on Fri 10 Feb 2006 09:41 GMT | Profile | Permanent Link
This can always be caught if instead of using:
<xsl:apply-templates select="$some-node-set"/> One used: f:apply-templates-nonempty($some-node-set") and the first argument of f:apply-templates-nonempty is of type node()+ The content of the xsl:function is of course: <xsl:apply-templates select="$arg1"/> Let's give this function to XQuery developers and see what happens next. Of course, I know that this may sound like heretics here, but this way of thinking has become very natural to me recently... Cheers, Dimitre. Re: Thoughts on schema-awareness
by
Michael Kay
on Fri 10 Feb 2006 09:47 GMT | Profile | Permanent Link
Well, that will tell you that the node-set is empty. But we knew that already, the problem was knowing why. Schema-awareness would have told us why it was empty, for example with a path expression like a/b/c/d[x=3]/e it would tell us that a d element cannot contain an x element.
|
Search
Recent Comments
Recent Articles
Month Archive
|
|||||||