Handling <xsd:any> data types

If you are working with an XML schema that contains one or more <xsd:any> data types, the XML assistants can map the data type to a pair of CICS containers. You can write an application program to parse the XML in the containers.

Before you begin

You must map the XML schema using DFHSC2LS or DFHWS2LS using a mapping level of 2.1 or higher.

About this task

When CICS transforms the data to XML, it puts the XML associated with the <xsd:any> data type in the first container and the namespace prefix declarations that are in scope in the second container.

Procedure

  1. To parse the XML data, use the TRANSFORM XMLTODATA command in your application program:
    EXEC CICS TRANSFORM XMLTODATA
         XMLTRANSFORM('MyXmlTransformName')
         CHANNEL('MyChannelName')
         XMLCONTAINER('SourceContainerName')
         DATCONTAINER('TargetContainerName')
         NSCONTAINER('NamespacesContainerName')
         ELEMNAME(elementName) ELEMNAMELEN(elementNameLength)

    MyXmlTransformName is the 32-character name of the XMLTRANSFORM resource that specifies the XML binding and schema; MyChannelName is the 16-character name of the channel that has the input and output containers; SourceContainerName is the 16-character name of the input container that holds the XML and TargetContainerName is the 16-character name of the output container that CICS populates with application data; NamespacesContainerName is the 16-character name of the container that CICS populates with the namespace prefix declarations. Provide initial values for the ELEMNAME and ELEMNAMELEN options.

    CICS returns the XML element and its length in the ELEMNAME and ELEMNAMELEN options.
  2. Install the application program in CICS.

What to do next

Test that the application program parses the XML correctly.