An Introduction to XML

  • Deborah Nolan
  • Duncan Temple Lang
Part of the Use R! book series (USE R)


This chapter aims to give a reasonably comprehensive definition and motivation for the various aspects of the generic XML language and also to illustrate these aspects with some existing XML dialects or vocabularies. We describe elements, attributes, child elements, and the hierarchical structure of XML. We talk about “well-formedness” of an XML document and how to identify errors in a document’s structure. We discuss the use of namespaces and end with a brief discussion of validating documents with respect to DTDs and XML Schema. Readers already familiar with all aspects of XML can skip this chapter and read about the functions used to work with XML in R, which are the subject of each of Chapters 3, 4, 5, and 6.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Apple, Inc. Numbers for iOS: Supported file formats., 2011.
  2. [2]
    Bert Bos, Tantek Celik, Ian Hickson, and Hakon Wium Lie. Cascading style sheets, level 2, revision 1 (CSS 2.1) specification. Worldwide Web Consortium, 2011.
  3. [3]
    Tim Bray, Dave Hollander, Andrew Layman, Richard Tobin, and Henry Thompson. Namespaces in XML 1.0. Worldwide Web Consortium, 2009.
  4. [4]
    James Clark. nXML mode: An addon for GNU Emacs., 2004.
  5. [5]
    Data Mining Group. Predictive Model Markup Language., 2011.
  6. [6]
    Economic Commission for Europe. Common open standards for the exchange and sharing of socio-economic data and metadata: The SDMX initiative., 2002.
  7. [7]
    European Central Bank. Euro foreign exchange reference rates., 2011.
  8. [8]
    European Central Bank. SDMX-ML and SDMX-EDI (GESMES/TS): The ECB statistical representation standards., 2011.
  9. [9]
    David Fallside and Priscilla Walmsley. XML schema, Part 0: Primer. Worldwide Web Consortium, 2004.
  10. [10]
    R. Gentleman, Elizabeth Whalen, W. Huber, and S. Falcon. graph: A package to handle graph data structures., 2011. R package version 1.33.0.
  11. [11]
    Google, Inc. Keyhole markup language (KML) reference., 2010.
  12. [12]
    Google, Inc. Google Earth: A 3D virtual earth browser, version 6., 2011.
  13. [13]
    Google, Inc. Google Maps: A Web mapping service application., 2011.
  14. [14]
    Google, Inc. Google documents list API: Allows developers to create, retrieve, update, and delete Google Docs., 2012.
  15. [15]
    Google, Inc. Google Sky: An online outer-space viewer., 2012.
  16. [16]
    John Gruber. Markdown: A text-to-HTML conversion tool for Web writers., 2004.
  17. [17]
    Elliotte Rusty Harold andW. Scott Means. XML in a Nutshell. O’Reilly Media, Inc., Sebastopol, CA, 2004.Google Scholar
  18. [18]
    David Hunter, Jeff Rafter, Joe Fawcett, Eric van der Vlist, Danny Ayers, Jon Duckett, Andrew Watt, and Linda McKinnon. Beginning XML. Wiley Publishing, Inc., Indianapolis, IN, fourth edition, 2007.Google Scholar
  19. [19]
    Bill Kennedy and Chuck Musciano. HTML and XHTML: The Definitive Guide. O’Reilly Media, Inc., Sebastopol, CA, 2006.Google Scholar
  20. [20]
    B. N. Lawrence, R. Lowry, P. Miller, H. Snaith, and A. Woolf. Information in environmental data grids. Philosophical Transactions of the Royal Society A: Mathematical, Physical, and Engineering Sciences, 367:1003–1014, 2009.CrossRefGoogle Scholar
  21. [21]
    LibreOffice; The Document Foundation. Calc: The LibreOffice spreadsheet program., 2011.
  22. [22]
    R.G. Mann, R.M. Baxter, R. Carroll, Q. Wen, O.P. Buneman, B. Choi, W. Fan, R.W.O. Hutchison, and S.D. Viglas. XML Data in the virtual observatory. Astronomical Data Analysis Software and Systems XIV, 347:223, 2005.Google Scholar
  23. [23]
    Deborah Nolan, Roger Peng, and Duncan Temple Lang. Enhanced dynamic documents for reproducible research. In M.F. Ochs, J.T. Casagrande, and R.V. Davuluri, editors, Biomedical Informatics for Cancer Research, pages 335–346. Springer-Verlag, New York, 2009.Google Scholar
  24. [24]
    Deborah Nolan and Duncan Temple Lang. Learning from the statistician’s lab notebook. In Data and Context in Statistics Education: Towards an Evidence-based Society. Proceedings of the Eighth International Conference on Teaching Statistics (ICOTS8, July, 2010), Ljubljana, Slovenia. Voorburg, 2010.Google Scholar
  25. [25]
    Open Geospatial Consortium, Inc. OGC KML standards., 2010.
  26. [26]
    Eric Raymond. DocBook demystification HOWTO, revision v1.3. The Linux Documentation Project, 2004.
  27. [27]
    Frank Rice. Introducing the Office (2007) Open XML file formats., 2006.
  28. [28]
    Yakov Shafranovich. Common format and MIME type for comma-separated values (CSV) files., 2011.
  29. [29]
    Richard Stallman. GNU Emacs: An extensible, customizable text editor., 2008.
  30. [30]
    Statistical Data and Metadata Exchange Initiative. SDMX information model: UML conceptual design (version 2.0)., 2005.
  31. [31]
    Bob Stayton. DocBook XSL: The Complete Guide. Sagehill Enterprises, Santa Cruz, CA, fourth edition, 2007.Google Scholar
  32. [32]
    Alex Szalay, Jim Gray, Ani Thakar, Bill Boroski, Roy Gai, Nolan Li, Peter Kunszt, Tanu Malik, Wil O’Mullane, Maria Nieto-Santisteban, Jordan Raddick, Chris Stoughton, and Jan van den Berg. The SDSS DR1 SkyServer: Public access to a terabyte of astronomical data., 2002.
  33. [33]
    Duncan Temple Lang. RTidyHTML: Tidy HTML documents., 2011. R package version 0.2-1.
  34. [34]
    Duncan Temple Lang. XML: Tools for parsing and generating XML within R and S-PLUS., 2011. R package version 3.4.
  35. [35]
    Duncan Temple Lang. XMLSchema: R facilities to read XML schema., 2012. R package version 0.7-0.
  36. [36]
    United Nations Statistical Commission. Report on the thirty-ninth session. (Supplement No. 4, E/2008/24)., 2008.
  37. [37]
    US Food and Drug Administration. Structured product labeling resources. default.htm, 2012.
  38. [38]
    Eric van der Vlist. XML Schema. O’Reilly Media, Inc., Sebastopol, CA, 2002.Google Scholar
  39. [39]
    W3Schools, Inc. XML tutorial., 2011.
  40. [40]
    W3Schools, Inc. DTD tutorial., 2012.
  41. [41]
    Priscilla Walmsley. Definitive XML Schema. Prentice Hall PTR, Upper Saddle River, NJ, 2001.Google Scholar
  42. [42]
    Norman Walsh and Leonard Muellner. DocBook: The Definitive Guide. O’Reilly Media, Inc., Sebastopol, CA, first edition, 1999.
  43. [43]
    Worldwide Web Consortium. Extensible Markup Language (XML) 1.0., 2008.

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  • Deborah Nolan
    • 1
  • Duncan Temple Lang
    • 2
  1. 1.Department of StatisticsUniversity of CaliforniaBerkeleyUSA
  2. 2.Department of StatisticsUniversity of CaliforniaDavisUSA

Personalised recommendations