Meta-Programming with XML Schema

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


This chapter discusses the functionality to read, process, and use XML schema within R. The primary goal is to be able to programmatically generate R classes and code to work with XML documents. Recall from Section 2.7 that an XML schema describes the structure, content and data types for XML documents in a particular XML vocabulary, grammar or format (e.g., PMML or KML). The information in the schema can be turned into S4 class definitions and R functions for reading and generating XML in R for that XML vocabulary. We can use these S4 classes to represent data that appear in the XML documents as R objects corresponding to the schema. This means we can both read XML into objects of these classes and also generate XML by serializing these R objects to XML. The key idea is that these classes and methods for reading and writing XML are generated programmatically. The XMLSchema package provides code that generates code for a given schema. R users do not need to interact directly with the contents of a schema, but can benefit from them to create structured R code and data.


Data Type Base Class Predictive Model Markup Language Converter Method Coercion Method 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Ethan Cerami. Web Services Essentials: Distributed Applications with XML-RPC, SOAP, UDDI & WSDL. O’Reilly Media, Inc., Sebastopol, CA, 2002.Google Scholar
  2. [2]
    Gabor Csardi. igraph: Network analysis and visualization., 2012. R package version 0.6.4.
  3. [3]
    Data Mining Group. Predictive Model Markup Language., 2011.
  4. [4]
    Economic Commission for Europe. Common open standards for the exchange and sharing of socio-economic data and metadata: The SDMX initiative., 2002.
  5. [5]
    Jeff Gentry, Li Long, Robert Gentleman, Seth Falcon, Florian Hahne, Deepayan Sarkar, and Kaspar Hansen. Rgraphviz: Provides plotting capabilities for R graph objects., 2011. R package version 2.2.1.
  6. [6]
    Florian Hahne. Rgraphviz: A new interface to render graphs using Rgraphviz., 2012.
  7. [7]
    Murat Koksalan, JyrkiWallenius, and Stanley Zionts. Multiple Criteria Decision Making: From Early History to the 21st Century. World Scientific Publishing Co. Pte. Ltd., Singapore, 2011.Google Scholar
  8. [8]
    Patrick Meyer and Sebastien Bigaret. RXMCDA., 2012. R package version 1.4.2.
  9. [9]
    Paul Murrell. gridSVG: Export grid graphics as SVG.˜paul/R/gridSVG/gridSVG_0.5-10.tar.gz, 2010. R package version 0.5.
  10. [10]
    National Center for Biotechnology Information. Entrez, the life sciences search engine., 2011.
  11. [11]
    Deborah Nolan and Duncan Temple Lang. SVGAnnotation: Tools for post-processing SVG plots created in R., 2011. R package version 0.9.
  12. [12]
    Duncan Temple Lang. RGCCTranslationUnit: R interface to GCC source code information., 2009. R package version 0.4-0.
  13. [13]
    Duncan Temple Lang. RCIndex: R interface to the clang parser’s C API., 2010. R package version 0.2-0.
  14. [14]
    Duncan Temple Lang. SJava., 2011.
  15. [15]
    Duncan Temple Lang. SWinTypeLibs: Type library information reader., 2011. R package version 0.6-0.
  16. [16]
    Duncan Temple Lang. XML: Tools for parsing and generating XML within R and S-PLUS., 2011. R package version 3.4.
  17. [17]
    Duncan Temple Lang. SSOAP: Client-side SOAP access for R., 2012. R package version 0.9-0.
  18. [18]
    Simon Urbanek. rJava: Low-level R to Java interface., 2011. R package version 0.9-3.
  19. [19]
    Eric van der Vlist. XML Schema. O’Reilly Media, Inc., Sebastopol, CA, 2002.Google Scholar
  20. [20]
    Priscilla Walmsley. Definitive XML Schema. Prentice Hall PTR, Upper Saddle River, NJ, 2001.Google Scholar
  21. [21]
    Graham Williams, Michael Hahsler, Hemant Ishwaran, Udaya Kogalur, and Rajarshi Guha. pmml: Generate PMML for various models., 2012. R package version 1.2.30.

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