Converting XML elements to SPL tuples by using the XMLParse operator

The XMLParse operator uses two mechanisms to convert incoming XML into tuples. In the explicit mechanism, the programmer defines in the operator the mapping from XML entity to SPL attribute. In the implicit mechanism, the mapping is derived from the definition of the output stream schema.

A tuple definition that corresponds to an XML element has up to three parts:
  • an attribute of type map<rstring,rstring> called _attrs to hold the XML attribute/value pairs
  • an attribute of type rstring called _text to hold the text content of the element
  • zero or more attributes of type tuple or list<tuple> which represent the nested XML elements
Explictly mapping the XML elements to SPL attributes
Implicitly deriving the SPL attributes from the XML output stream