skip to main content
article
Free Access

Static validation of XSL transformations

Published:01 August 2007Publication History
Skip Abstract Section

Abstract

XSL Transformations (XSLT) is a programming language for defining transformations among XML languages. The structure of these languages is formally described by schemas, for example using DTD or XML Schema, which allows individual documents to be validated. However, existing XSLT tools offer no static guarantees that, under the assumption that the input is valid relative to the input schema, the output of the transformation is valid relative to the output schema.

We present a validation technique for XSLT based on the XML graph formalism introduced in the static analysis of JWIG Web services and XACT XML transformations. Being able to provide static guarantees, we can detect a large class of errors in an XSLT stylesheet at the time it is written instead of later when it has been deployed, and thereby provide benefits similar to those of static type checkers for modern programming languages.

Our analysis takes a pragmatic approach that focuses its precision on the essential language features but still handles the entire XSLT language. We evaluate the analysis precision on a range of real stylesheets and demonstrate how it may be useful in practice.

References

  1. Altova. 2005. XMLSpy. http://www.altova.com/xmlspy.Google ScholarGoogle Scholar
  2. Ambroziak, J., Jørgensen, M., Zongaro, A., and colleagues 2004. XSLTC. http://xml.apache.org/xalan-j/xsltc/xsltc_compiler.html.Google ScholarGoogle Scholar
  3. Audebaud, P. and Rose, K. 2000. Stylesheet validation. Tech. Rep. RR2000-37, ENS-Lyon. November.Google ScholarGoogle Scholar
  4. Benedikt, M., Fan, W., and Geerts, F. 2005. XPath satisfiability in the presence of DTDs. In Proceedings of the 24th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS '05. 25--36. Google ScholarGoogle Scholar
  5. Bex, G. J., Maneth, S., and Neven, F. 2002. A formal model for an expressive fragment of XSLT. Information Systems 27, 1, 21--39. Google ScholarGoogle Scholar
  6. Bierman, G., Meijer, E., and Schulte, W. 2005. The essence of data access in Cω. In Proceedings of the 19th European Conference on Object-Oriented Programming, ECOOP '05. LNCS, vol. 3586. Springer-Verlag.Google ScholarGoogle Scholar
  7. Brabrand, C., Møller, A., and Schwartzbach, M. I. 2001. Static validation of dynamically generated HTML. In Proceedings of the ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE '01. 221--231. Google ScholarGoogle Scholar
  8. Brabrand, C., Møller, A., and Schwartzbach, M. I. 2002. The <bigwig> project. ACM Trans. Internet Tech. 2, 2, 79--114. Google ScholarGoogle Scholar
  9. Bray, T., Paoli, J., Sperberg-McQueen, C. M., Maler, E., and Yergeau, F. 2004. Extensible Markup Language (XML) 1.0 (third edition). W3C Recommendation. http://www.w3.org/TR/REC-xml. Google ScholarGoogle Scholar
  10. Christensen, A. S., Møller, A., and Schwartzbach, M. I. 2002. Static analysis for dynamic XML. Tech. Rep. RS-02-24, BRICS. May. Presented at Programming Language Technologies for XML, PLAN-X '02.Google ScholarGoogle Scholar
  11. Christensen, A. S., Møller, A., and Schwartzbach, M. I. 2003. Extending Java for high-level Web service construction. ACM Trans. Program. Lang. Sys. 25, 6, 814--875. Google ScholarGoogle Scholar
  12. Clark, J. 1999. XSL transformations (XSLT). W3C Recommendation. http://www.w3.org/TR/xslt.Google ScholarGoogle Scholar
  13. Clark, J. and DeRose, S. 1999. XML path language. W3C Recommendation. http://www.w3.org/TR/xpath.Google ScholarGoogle Scholar
  14. Dong, C. and Bailey, J. 2004. Static analysis of XSLT programs. In Proceedings of the 15th Australasian Database Conference, ADC '04. Australian Computer Society. Google ScholarGoogle Scholar
  15. Draper, D., Frankhauser, P., Fernández, M., Malhotra, A., Rose, K., Rys, M., Siméon, J., and Wadler, P. 2002. XQuery 1.0 and XPath 2.0 formal semantics. W3C Working Draft. http://www.w3.org/TR/query-semantics/.Google ScholarGoogle Scholar
  16. Harren, M., Raghavachari, M., Shmueli, O., Burke, M. G., Bordawekar, R., Pechtchanski, I., and Sarkar, V. 2005. XJ: Facilitating XML processing in Java. In Proceedings of the 14th International Conference on the World Wide Web, WWW '05. ACM, 278--287. Google ScholarGoogle Scholar
  17. Hidders, J. 2003. Satisfiability of XPath expressions. In Proceedings of the 9th International Workshop on Database Programming Languages, DBPL '03. LNCS. Springer-Verlag.Google ScholarGoogle Scholar
  18. Hopcroft, J. E. and Ullman, J. D. 1979. Introduction to Automata Theory, Languages and Computation. Addison-Wesley. Google ScholarGoogle Scholar
  19. Hosoya, H. and Pierce, B. C. 2003. XDuce: A statically typed XML processing language. ACM Trans. Internet Tech. 3, 2, 117--148. Google ScholarGoogle Scholar
  20. Jagannathan, S. and Weeks, S. 1995. A unified treatment of flow analysis in higher-order languages. In Proceedings of the 22th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '95. 393--407. Google ScholarGoogle Scholar
  21. Kay, M. 2004. Saxon. http://saxon.sourceforge.net/.Google ScholarGoogle Scholar
  22. Kay, M. 2006. XSL transformations (XSLT) version 2.0. W3C Candidate Recommendation. http://www.w3.org/TR/xslt20/.Google ScholarGoogle Scholar
  23. Kepser, S. 2002. A proof of the Turing-completeness of XSLT and XQuery. Tech. rep., SFB 441, University of Tübingen.Google ScholarGoogle Scholar
  24. Kirkegaard, C. and Møller, A. 2005. Type checking with XML Schema in Xact. Tech. Rep. RS-05-31, BRICS. Presented at Programming Language Technologies for XML, PLAN-X '06.Google ScholarGoogle Scholar
  25. Kirkegaard, C., Møller, A., and Schwartzbach, M. I. 2004. Static analysis of XML transformations in Java. IEEE Trans. Softw. Eng. 30, 3 (Mar.), 181--192. Google ScholarGoogle Scholar
  26. Kirkegaard, C. and Møller, A. 2007. dk.brics.schematools. http://www.brics.dk/schematools/.Google ScholarGoogle Scholar
  27. Klarlund, N. and Møller, A. 2001. MONA Version 1.4 User Manual. BRICS, Department of Computer Science, University of Aarhus. Notes Series NS-01-1.Google ScholarGoogle Scholar
  28. Klarlund, N., Møller, A., and Schwartzbach, M. I. 2002. MONA implementation secrets. Inter. J. Found. Comput. Sci. 13, 4, 571--586. World Scientific Publishing Company.Google ScholarGoogle Scholar
  29. Klarlund, N. and Schwartzbach, M. I. 1993. Graph types. In Proceedings of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '93. Google ScholarGoogle Scholar
  30. Kuula, S. 2006. Practical type-safe XSLT 2.0 stylesheet authoring. M. S. thesis, Department of Computer Science, University of Aarhus.Google ScholarGoogle Scholar
  31. Maneth, S., Berlea, A., Perst, T., and Seidl, H. 2005. XML type checking with macro tree transducers. In Proceedings of the 24th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS '05. 283--294. Google ScholarGoogle Scholar
  32. Martens, W. and Neven, F. 2003. Typechecking top-down uniform unranked tree transducers. In 9th International Conference on Database Theory. LNCS, vol. 2572. Springer-Verlag. Google ScholarGoogle Scholar
  33. Martens, W. and Neven, F. 2004. Frontiers of tractability for typechecking simple XML transformations. In Proceedings of the 23rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS '04. 23--34. Google ScholarGoogle Scholar
  34. Milo, T., Suciu, D., and Vianu, V. 2002. Typechecking for XML transformers. J. Comput. Syst. Sci. 66, 66--97. Google ScholarGoogle Scholar
  35. Møller, A. 2002. Document Structure Description 2.0. BRICS, Department of Computer Science, University of Aarhus, Notes Series NS-02-7. Available from http://www.brics.dk/DSD/.Google ScholarGoogle Scholar
  36. Møller, A. and Schwartzbach, M. I. 2005. The design space of type checkers for XML transformation languages. In Proceedings of the 10th International Conference on Database Theory, ICDT '05. LNCS, vol. 3363. Springer-Verlag, 17--36. Google ScholarGoogle Scholar
  37. Møller, A. and Schwartzbach, M. I. 2007. XML graphs in program analysis. In Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM '07. Google ScholarGoogle Scholar
  38. Neven, F. and Schwentick, T. 2003. XPath containment in the presence of disjunction, DTDs, and variables. In Proceedings of the 9th International Conference on Database Theory, ICDT '03. Springer-Verlag, 315--329. Google ScholarGoogle Scholar
  39. Ogbuji, C. 2003. Visualizing XSLT in SVG. http://www.xml.com/pub/a/2003/06/04/xslt-svg.html.Google ScholarGoogle Scholar
  40. Predescu, O. and Addyman, T. 2005. XSLT-process. http://xslt-process.sourceforge.net/.Google ScholarGoogle Scholar
  41. Schwentick, T. 2004. XPath query containment. ACM SIGMOD Record 33, 1, 101--109. Google ScholarGoogle Scholar
  42. Stylus Studio. 2005. XSL Debugger. http://www.stylusstudio.com/xsl_debugger.html.Google ScholarGoogle Scholar
  43. Thompson, H. S., Beech, D., Maloney, M., and Mendelsohn, N. 2004. XML Schema part 1: Structures second edition. W3C Recommendation. http://www.w3.org/TR/xmlschema-1/.Google ScholarGoogle Scholar
  44. Tozawa, A. 2001. Towards static type checking for XSLT. In Proceedings of the ACM Symposium on Document Engineering, DocEng '01. Google ScholarGoogle Scholar
  45. Wadler, P. 2000. A formal semantics of patterns in XSLT and XPath. Markup Languages 2, 2, 183--202. Google ScholarGoogle Scholar
  46. Wood, P. T. 2003. Containment for XPath fragments under DTD constraints. In Proceedings of the 9th International Conference on Database Theory, ICDT '03. Springer-Verlag, 300--314. Google ScholarGoogle Scholar

Index Terms

  1. Static validation of XSL transformations

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              • Published in

                cover image ACM Transactions on Programming Languages and Systems
                ACM Transactions on Programming Languages and Systems  Volume 29, Issue 4
                August 2007
                244 pages
                ISSN:0164-0925
                EISSN:1558-4593
                DOI:10.1145/1255450
                Issue’s Table of Contents

                Copyright © 2007 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 1 August 2007
                Published in toplas Volume 29, Issue 4

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!