MF 

XML Syntax - READ Statement

The READ statement in XML syntax reads an XML document from an I/O stream or retrieves an XML element from the in-memory representation of an XML document.

Format


XML Syntax - READ statement

Syntax Rules:

  1. File-name-1 is the filename as declared in the SELECT statement as ORGANIZATION IS XML.
  2. Data-name-1 can be qualified, and references a data item whose declaration includes an IDENTIFIED BY clause and is included in the XD record declarations for file-name-1.

General Rules:

  1. The READ statement without NEXT KEY specified reads an XML document and creates an internal tree-based representation of that document. In addition, it populates the appropriate record definition from the XD with as much data as possible, based on the record elements and occurrence limitations of the associated XML tags. The populated elements are associated with their in-memory counterparts to allow DELETE, REWRITE, and WRITE to modify the internal representation.
  2. READ NEXT finds the associated internal counterpart of the indicated key and either populates the key and all subordinate items with the next occurrence of that internal counterpart, or returns end-of-file if there is no next occurrence.
  3. No stream I/O is actually performed by the READ NEXT KEY IS statement.
  4. The READ statement cannot read PROCESSING-INSTRUCTIONs that are outside the body of the XML record. If you need this flexibility, use the XML PARSE verb.