[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How do you ensure that data is not altered/corrupt
General agreement here, and some additional principles:
1. Define your expectations. The XSLT was written ostensibly to do some changes. Document for yourself (and others) exactly what changes are expected and which are tolerated. Any other change is, presumably, not desirable. 2. Try one or more tools. Already mentioned in this thread has been XSpec, Schematron, and hashing. You want to make sure that the tool you pick can handle the expectations you defined in #1, and that you're comfortable with it. 3. Automate your testing tool. Again, it depends upon what you've picked and your comfort level, but you can use shell/batch scripts, XProc, ant, Python, C#, etc. One more method to consider: write a reverse XSLT to attempt to change the output back into the original. Then you can apply one of several available straightforward comparisons. I used this reverse XSLT strategy in a situation where I needed to parse thousands of plain text files into lossless XML. I wrote the reverse XSLT while developing the main code, which helped me both to define my expectations (on, e.g., whitespace, line breaks) and to quickly find errors in my primary code base. When the project was finished, I was able to demonstrate to my colleagues that the application was completely faithful to the original. Because both the forward and the reverse XSLT were written declaratively, auditors were better placed to understood both intent and reality of the code than if I had adopted a procedural/imperative approach. (If the output you're testing is lossy vis-C -vis the original, you might need to write two sets of reverse XSLT, one to scrap the losses in the original and the second to restore the output as best as possible.) Hope this helps, Joel On 2023-05-19 04:13, Michael Kay mike@xxxxxxxxxxxx wrote: Testing, testing, testing. Plus tools to help prevent the mistakes arising in the first place. -- Joel Kalvesmaki Director, Text Alignment Network http://textalign.net
|
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
|