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.
- Altova. 2005. XMLSpy. http://www.altova.com/xmlspy.Google Scholar
- Ambroziak, J., Jørgensen, M., Zongaro, A., and colleagues 2004. XSLTC. http://xml.apache.org/xalan-j/xsltc/xsltc_compiler.html.Google Scholar
- Audebaud, P. and Rose, K. 2000. Stylesheet validation. Tech. Rep. RR2000-37, ENS-Lyon. November.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Brabrand, C., Møller, A., and Schwartzbach, M. I. 2002. The <bigwig> project. ACM Trans. Internet Tech. 2, 2, 79--114. Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Clark, J. 1999. XSL transformations (XSLT). W3C Recommendation. http://www.w3.org/TR/xslt.Google Scholar
- Clark, J. and DeRose, S. 1999. XML path language. W3C Recommendation. http://www.w3.org/TR/xpath.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Hidders, J. 2003. Satisfiability of XPath expressions. In Proceedings of the 9th International Workshop on Database Programming Languages, DBPL '03. LNCS. Springer-Verlag.Google Scholar
- Hopcroft, J. E. and Ullman, J. D. 1979. Introduction to Automata Theory, Languages and Computation. Addison-Wesley. Google Scholar
- Hosoya, H. and Pierce, B. C. 2003. XDuce: A statically typed XML processing language. ACM Trans. Internet Tech. 3, 2, 117--148. Google Scholar
- 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 Scholar
- Kay, M. 2004. Saxon. http://saxon.sourceforge.net/.Google Scholar
- Kay, M. 2006. XSL transformations (XSLT) version 2.0. W3C Candidate Recommendation. http://www.w3.org/TR/xslt20/.Google Scholar
- Kepser, S. 2002. A proof of the Turing-completeness of XSLT and XQuery. Tech. rep., SFB 441, University of Tübingen.Google Scholar
- 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 Scholar
- 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 Scholar
- Kirkegaard, C. and Møller, A. 2007. dk.brics.schematools. http://www.brics.dk/schematools/.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Kuula, S. 2006. Practical type-safe XSLT 2.0 stylesheet authoring. M. S. thesis, Department of Computer Science, University of Aarhus.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Milo, T., Suciu, D., and Vianu, V. 2002. Typechecking for XML transformers. J. Comput. Syst. Sci. 66, 66--97. Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Ogbuji, C. 2003. Visualizing XSLT in SVG. http://www.xml.com/pub/a/2003/06/04/xslt-svg.html.Google Scholar
- Predescu, O. and Addyman, T. 2005. XSLT-process. http://xslt-process.sourceforge.net/.Google Scholar
- Schwentick, T. 2004. XPath query containment. ACM SIGMOD Record 33, 1, 101--109. Google Scholar
- Stylus Studio. 2005. XSL Debugger. http://www.stylusstudio.com/xsl_debugger.html.Google Scholar
- 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 Scholar
- Tozawa, A. 2001. Towards static type checking for XSLT. In Proceedings of the ACM Symposium on Document Engineering, DocEng '01. Google Scholar
- Wadler, P. 2000. A formal semantics of patterns in XSLT and XPath. Markup Languages 2, 2, 183--202. Google Scholar
- 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 Scholar
Index Terms
Static validation of XSL transformations
Recommendations
Extracting output schemas from XSLT stylesheets and their possible applications
DCMI'12: Proceedings of the 2012 International Conference on Dublin Core and Metadata ApplicationsXML is nowadays the dominant standard used for data representation and exchanging. XML documents can be transformed into different formats by using the transformation language XSLT. XSLT stylesheets can be designed to present and transform XML input ...
Compiler support for effective XSL transformation
XML is a markup language used to describe data or documents. The main goal of XML is to facilitate the sharing of data across diverse information systems, especially via the Internet. XML Stylesheet Transformations (XSLT) is a standard approach to ...
WMS and GML based interoperable web mapping system
GIS '01: Proceedings of the 9th ACM international symposium on Advances in geographic information systemsRecently the World Wide Web has become a popular vehicle for information distributation and web based geographic information system (GIS) are rapidly evolving and adapting to these new environments. The main hindrance for building true interoperable ...






Comments