xsl-list
[Top] [All Lists]

Re: [xsl] Avoiding boneheaded mistakes in XSLT?

2010-12-29 08:46:17
At 2010-12-29 14:39 +0000, Dave Pawson wrote:
On Wed, 29 Dec 2010 13:14:15 +0000
David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

> On 29/12/2010 13:09, Piet van Oostrum wrote:
> > It would be nice if processors would have a debug mode in which
> > XPath expressions would be checked against a schema or DTD and give
> > a warning when some 'impossible' expression is encountered.
> > Impossible meaning something that never can give a non-empty result
> > on valid documents. Probably just paths that are illegal according
> > to the schema.
>
>
> That's exactly what a schema aware xpath2 processor will do.
>
> David

Even without schema awareness/context, surely the processor can
tell when an xpath expression will result in zero match?

But it isn't helpful because the zero match is ambiguously either the result of a typo in the stylesheet or the absence of an acceptable item in the source. The processor is obliged to assume the latter and so cannot assume the former.

I hope this helps.

. . . . . . . . . . Ken

--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--