Skip to main content

XML Validation for Context-Free Grammars

  • Conference paper
Programming Languages and Systems (APLAS 2006)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4279))

Included in the following conference series:

Abstract

String expression analysis conservatively approximates the possible string values generated by a program. We consider the validation of a context-free grammar obtained by the analysis against XML schemas and develop two algorithms for deciding inclusion L(G 1) ⊆ L(G 2) where G 1 is a context-free grammar and G 2 is either an XML-grammar or a regular hedge grammar. The algorithms for XML-grammars and regular hedge grammars have exponential and doubly exponential time complexity, respectively. We have incorporated the algorithms into the PHP string analyzer and validated several publicly available PHP programs against the XHTML DTD. The experiments show that both of the algorithms are efficient in practice although they have exponential complexity.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Berstel, J., Boasson, L.: Formal properties of XML grammars and languages. Acta Informatica 38(9), 649–671 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  2. Brabrand, C., Møller, A., Schwartzbach, M.I.: Static validation of dynamically generated HTML. In: Proceedings of the 2001 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis For Software Tools and Engineering, pp. 38–45 (2001)

    Google Scholar 

  3. Clark, J., Murata, M.: RELAX NG specification (2001), http://www.oasis-open.org/committees/relax-ng/spec

  4. Christensen, A.S., Møller, A., Schwartzbach, M.I.: Extending Java for high-level web service construction. ACM Transactions on Programming Languages and Systems 25(6), 814–875 (2003)

    Article  Google Scholar 

  5. Christensen, A.S., Møller, A., Schwartzbach, M.I.: Precise analysis of string expressions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 1–18. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  6. Greibach, S.A., Friedman, E.P.: Superdeterministic PDAs: A subcase with a decidable inclusion problem. Journal of the Association for Computing Machinery 27(4), 675–700 (1980)

    MATH  MathSciNet  Google Scholar 

  7. Harrison, M.A.: Introduction to Formal Language Theory, ch. 4. Addison-Wesley, Reading (1978)

    Google Scholar 

  8. Hosoya, H., Pierce, B.: XDuce: A statically typed XML processing language. ACM Transactions on Internet Technology 3(2), 117–148 (2003)

    Article  Google Scholar 

  9. Hosoya, H., Vouillon, J., Pierce, B.: Regular expression types for XML. ACM Transactions on Programming Languages and Systems 27(1), 46–90 (2005)

    Article  Google Scholar 

  10. Knuth, D.E.: A characterization of parenthesis languages. Information and Control 11(3), 269–289 (1967)

    Article  MATH  Google Scholar 

  11. McNaughton, R.: Parenthesis grammars. Journal of the Association for Computing Machinery 14(3), 490–500 (1967)

    MATH  MathSciNet  Google Scholar 

  12. Minamide, Y.: Static approximation of dynamically generated Web pages. In: Proceedings of the 14th International World Wide Web Conference, pp. 432–441. ACM Press, New York (2005)

    Chapter  Google Scholar 

  13. Murata, M.: Hedge automata: a formal model for XML schemata (1999), http://www.xml.gr.jp/relax/hedge_nice.html

  14. Plandowski, W.: Testing equivalence of morphisms on context-free languages. In: van Leeuwen, J. (ed.) ESA 1994. LNCS, vol. 855, pp. 460–470. Springer, Heidelberg (1994)

    Chapter  Google Scholar 

  15. Pair, C., Quere, A.: Définition et étude des bilangages réguliers. Information and Control 13(6), 565–593 (1968)

    Article  MATH  MathSciNet  Google Scholar 

  16. Takahashi, M.: Generalizations of regular sets and their application to a study of context-free languages. Information and Control 21(1), 1–36 (1975)

    Article  Google Scholar 

  17. Tozawa, A.: XML type checking using high-level tree transducer. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 81–96. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Minamide, Y., Tozawa, A. (2006). XML Validation for Context-Free Grammars. In: Kobayashi, N. (eds) Programming Languages and Systems. APLAS 2006. Lecture Notes in Computer Science, vol 4279. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11924661_22

Download citation

  • DOI: https://doi.org/10.1007/11924661_22

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-48937-5

  • Online ISBN: 978-3-540-48938-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics