|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: My XPath mistakenly referenced an element that do
On Thu, Oct 14, 2021 at 03:17:08PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit:
> I've sometimes wondered whether a "soft" checker (lint-like) that warns you of potentially void paths (by reference to a schema and/or instance document) might not be a valuable tool.
Any kind of XSLT linter would be a fine thing to have.
> Or a run-time checker might be less complicated than a compile-time checker: Add an option selection="strict" at the xsl:transform level, and then
>
> Document/foo is treated as one-or-more(Document)/one-or-more(foo)
>
> while if you want zero-or-more(Document)/zero-or-more(foo)
>
> then you have to use some new syntax like opt(Document)/opt(foo)
>
> Even adding req() as a synonym for one-or-more() might be enough to encourage people to write req(Document)/req(foo) in order to get better diagnostics.
I prefer keeping the default behaviour of the XPath expression and
adding req(). This would be very handy for those "of course there's a
document, wait, oops" expressions.
> Or perhaps a "\" operator that behaves like "/" except the RHS is not allowed to be empty.
Overloading backslash seems a titch rash. And this would be harder to
read than req() would be.
--
Graydon Saunders | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor ("That passed, so may this.")
|
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
|

Cart








