Subject: Re: [xsl] How do you ensure that data is not altered/corrupted in a transformation? From: "Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 19 May 2023 14:46:16 -0000 |
Another option is to simply not use XSLT, which has a higher risk of unintended side effects that are hard to detect by code inspection. Which XQuery is less convenient for writing transforms, its procedural nature makes it much easier to write code that can be more completely inspected for correctness. Dito Python, Javascript, etc. And as Wendell says, therebs ultimately no substitute for human analysis of the output coupled with testing against the widest and most realistic content set you can (ideally the entire actual corpus). I also second the utility of both Schematron and XSpec as tools for testing and validationin the face of intrinsically difficult things to test. Cheers, E. _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow> From: Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Friday, May 19, 2023 at 9:30 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: [xsl] How do you ensure that data is not altered/corrupted in a transformation? [External Email] ________________________________ Hello again XSL-List, Posting from my bother emailb (apologies to indexers) b Itbs worth remarking on Rogerbs general problem that rewriting b10000b as b1000b (or something) is only one of the many conceivable things that might go wrong inside a black box, against which one might test. Then too, testing for data fidelity (as I call it) is one kind of testing, but it wonbt protect against errors such as failing to account for different units of measure for `altitude` and `alt` (in their respective vocabularies), or their meaning something entirely different. (Does anyone else remember the Stonehenge replica in Spinal Tap?) Early detection of problems like this is possible, but only when they are expected and defended against by staging mockups and testing models against use cases. This may sound like a lot of work until you realize it is nothing new, but (at some level) how things have always had to be done. It can only be made bautomaticb if we understand it i.e. are not oblivious to it, paradoxical as that sounds. The reason this scales is that bweb can be a small number (serving a larger number who can remain oblivious) b but it canbt be zero, or things gets loose and break. An automaton does not bunderstandb anything, it only captures and codifies some kind of understanding. Whether that understanding is adequate or btrueb is something it canbt know, because it doesnbt know anything at all. Cheers, Wendell From: Wendell Piez wapiez@xxxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, May 19, 2023 7:37 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] How do you ensure that data is not altered/corrupted in a transformation? XSpec is a unit testing framework for and in XSLT. Its capabilities go far beyond what schema validation was ever intended to do. Roger, if you aren't using XSpec, you should be. https://github.com/xspec/xspec/wiki<https://github.com/xspec/xspec/wiki> Regards, Wendell On Fri, May 19, 2023 at 6:13b/AM Michael Kay mike@xxxxxxxxxxxx<mailto:mike@xxxxxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx rytech.com>> wrote: Testing, testing, testing. Plus tools to help prevent the mistakes arising in the first place. Schema validation can catch a lot of the errors, but it won't catch them all. We had a case like this where a customer was flagging up dangerous levels of some reading in medical reports by displaying the relevant figures in red. When they upgraded from XSLT 1.0 to 2.0, the test $level > $dangerLevel started doing a string comparison rather than a numeric comparison, with the effect that the red flags weren't appearing -- and it took them months to notice, because they weren't doing enough testing. Hopefully no-one died. Tests are the only answer: and because stylesheets can be thrown together quickly, people often neglect to follow good software engineering disciplines when changing them. Michael Kay Saxonica > On 19 May 2023, at 09:37, Roger L Costello costello@xxxxxxxxx<mailto:costello@xxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx rytech.com>> wrote: > > Hi Folks, > > In certain domains loss of life may occur if data is altered/corrupted in any way. > > Suppose you write an XSLT program which transforms this: > > <alt>12000 feet</alt> > > to this: > > <altitude>12000 feet</altitude> > > How do you ensure that the data -- 12000 feet -- was not altered/corrupted in the transformation? > > I have heard of people doing a hash on the data prior to the transformation, a hash on the data after the transformation, and then comparing the hashes. Is that what you would do when lives are on the line? What is your recommendation? > > /Roger > > -- ...Wendell Piez... ...wendell -at- nist -dot- gov... ...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org... ...github.com/wendellpiez.<http://github.com/wendellpiez.>.. gitlab.coko.foundation/wendell<http://gitlab.coko.foundation/wendell>... XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list> EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3302254> (by email) XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list> EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3453418> (by email<>)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How do you ensure that da, Piez, Wendell A. (Fe | Thread | Re: [xsl] How do you ensure that da, Michael Kay mike@xxx |
Re: [xsl] How do you ensure that da, Piez, Wendell A. (Fe | Date | Re: [xsl] How do you ensure that da, Michael Kay mike@xxx |
Month |