Skip to main content

Embedding Multiple Representations

Within the same document instance, it is possible to switch to a different representation and therefore handle embedded data. This is particularly useful for example when processing multiple unrelated XML documents in a single document instance. Even though the XML documents may have different sets of namespaces they can be processed as if they were a single document by enclosing them in a structure with a flat representation.

The mechanism for embedding representations is to use the ReadNested at the element that inherits from the structure of the desired representation to switch to. Look at the first example for how this is done.

When using the ReadNested function, you must use another I/O function enclosing it. For maps that don't have any special I/O handling beyond ReadNested, use the ReadMapInput.

The ReadNested function can also be nested. In the first example the outer representation is flat, which contains two XML structures one of which contains another structure switching back to flat to handle a small portion of CSV embedded in the XML. The second example shows this in isolation.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!