Subject: Re: [xsl] My XPath mistakenly referenced an element that doesn't exist and I got no error message ... is this bad language design? From: "Tony Graham tgraham@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 15 Oct 2021 08:08:35 -0000 |
On 14/10/2021 14:45, Roger L Costello costello@xxxxxxxxx wrote: ...
I ran the XSLT program on the XML document. No error was generated....
My colleague argues that such behavior is bad language design:
Do you agree with my colleague's assessment? Is this behavior in XPath an indication of bad language design?
I can't find a requirements document for XSLT 1.0, but if there was one, it probably mentioned needing to run in a browser. At that point, you generally can't stop and ask for better input. As it was, the Yellow Screen of Death (YSoD) from non-well-formed XML soured the use of XML in the browser for many people.
AFAICT, XPointer generates an error [1] if none of possibly multiple 'pointer parts' identify a subresource but it doesn't matter how many pointer parts fail before there's one that succeeds.
Later XPath versions would have had a requirement to try to maintain backwards compatibility.
Hindsight and changed expectations might let us say that of course XPath should error if there's no match but that we're talking about it on a mailing list in 2021 instead of in the WG in 1998 suggests that it wasn't important back then.
Maybe the question is whether (current) XPath was a bad language choice. Maybe it's whether you should have coded more defensively (as your colleague pointed out) or (as others pointed out) used more XSLT features or used other technologies such as Schematron or XSpec tests to save you from yourself.
Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@xxxxxxxxxxxxx
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] My XPath mistakenly refer, BR Chrisman brchrism | Thread | [xsl] [ANN] Oxygen XML Editor versi, Octavian Nadolu octa |
Re: [xsl] Side notes layout in xslt, dvint dvint@xxxxxxxx | Date | Re: [xsl] replace a string that is , Prady Prady prady.ch |
Month |