Skip to main content

Meta-Programming with XML Schema

  • Chapter
  • First Online:
XML and Web Technologies for Data Sciences with R

Part of the book series: Use R! ((USE R))

  • 12k Accesses

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.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Ethan Cerami. Web Services Essentials: Distributed Applications with XML-RPC, SOAP, UDDI & WSDL. O’Reilly Media, Inc., Sebastopol, CA, 2002.

    Google Scholar 

  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. Data Mining Group. Predictive Model Markup Language. http://www.dmg.org/pmmlv3-2.html , 2011.

  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. 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. 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. 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. Patrick Meyer and Sebastien Bigaret. RXMCDA. http://cran.r-project.org/package=RXMCDA , 2012. R package version 1.4.2.

  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. National Center for Biotechnology Information. Entrez, the life sciences search engine. http://www.ncbi.nlm.nih.gov/gquery , 2011.

  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. Duncan Temple Lang. RGCCTranslationUnit: R interface to GCC source code information. http://www.omegahat.org/RGCCTranslationUnit , 2009. R package version 0.4-0.

  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. Duncan Temple Lang. SJava. http://cran.r-project.org/package=SJava , 2011.

  15. Duncan Temple Lang. SWinTypeLibs: Type library information reader. http://www.omegahat.org/SWinTypeLibs , 2011. R package version 0.6-0.

  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. Duncan Temple Lang. SSOAP: Client-side SOAP access for R. http://www.omegahat.org/SSOAP , 2012. R package version 0.9-0.

  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. Eric van der Vlist. XML Schema. O’Reilly Media, Inc., Sebastopol, CA, 2002.

    Google Scholar 

  20. Priscilla Walmsley. Definitive XML Schema. Prentice Hall PTR, Upper Saddle River, NJ, 2001.

    Google Scholar 

  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.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer Science+Business Media New York

About this chapter

Cite this chapter

Nolan, D., Lang, D.T. (2014). Meta-Programming with XML Schema. In: XML and Web Technologies for Data Sciences with R. Use R!. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-7900-0_14

Download citation

Publish with us

Policies and ethics