Advertisement

Meta-Programming with XML Schema

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

Abstract

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.

Keywords

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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. http://cran.r-project.org/web/packages/igraph/index.html, 2012. R package version 0.6.4.
  3. [3]
    Data Mining Group. Predictive Model Markup Language. http://www.dmg.org/pmmlv3-2.html, 2011.
  4. [4]
    Economic Commission for Europe. Common open standards for the exchange and sharing of socio-economic data and metadata: The SDMX initiative. http://sdmx.org/docs/2002/wp11.pdf, 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. http://www.bioconductor.org/packages/2.11/bioc/html/Rgraphviz.html, 2011. R package version 2.2.1.
  6. [6]
    Florian Hahne. Rgraphviz: A new interface to render graphs using Rgraphviz. http://www.bioconductor.org/packages/2.11/bioc/vignettes/Rgraphviz/inst/doc/newRgraphvizInterface.pdf, 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. http://cran.r-project.org/package=RXMCDA, 2012. R package version 1.4.2.
  9. [9]
    Paul Murrell. gridSVG: Export grid graphics as SVG. http://www.stat.auckland.ac.nz/˜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. http://www.ncbi.nlm.nih.gov/gquery, 2011.
  11. [11]
    Deborah Nolan and Duncan Temple Lang. SVGAnnotation: Tools for post-processing SVG plots created in R. http://www.omegahat.org/SVGAnnotation, 2011. R package version 0.9.
  12. [12]
    Duncan Temple Lang. RGCCTranslationUnit: R interface to GCC source code information. http://www.omegahat.org/RGCCTranslationUnit, 2009. R package version 0.4-0.
  13. [13]
    Duncan Temple Lang. RCIndex: R interface to the clang parser’s C API. http://www.omegahat.org/RCIndex, 2010. R package version 0.2-0.
  14. [14]
    Duncan Temple Lang. SJava. http://cran.r-project.org/package=SJava, 2011.
  15. [15]
    Duncan Temple Lang. SWinTypeLibs: Type library information reader. http://www.omegahat.org/SWinTypeLibs, 2011. R package version 0.6-0.
  16. [16]
    Duncan Temple Lang. XML: Tools for parsing and generating XML within R and S-PLUS. http://www.omegahat.org/RSXML, 2011. R package version 3.4.
  17. [17]
    Duncan Temple Lang. SSOAP: Client-side SOAP access for R. http://www.omegahat.org/SSOAP, 2012. R package version 0.9-0.
  18. [18]
    Simon Urbanek. rJava: Low-level R to Java interface. http://cran.r-project.org/package=rJava, 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. http://cran.r-project.org/web/packages/pmml/index.html, 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