Parse XML is a synchronous activity that takes a binary XML file or an XML string and converts it into an XML schema tree based on the XSD specified.
Parsing Date and Datetime Strings
In XML documents parsed by the Parse XML activity, datetime values are read in accordance with the ISO-8601 standard, as described in the XML Schema specification. For example, the value:
is 55 minutes, 31 seconds, and 112 milliseconds after 2.00 p.m. on February 10th, 2002 in a time zone that is 8 hours, 0 minutes behind UTC.
If no time zone field is present, the value is interpreted in the time zone of the machine that is performing the parsing. This can lead to complications if you are processing XML from a different time zone, so you are encouraged to always use a time zone.
The General tab has the following fields.
|Name||The name to be displayed as the label for the activity in the process.|
|Input Style||Can be
In binary mode, the binary content is read. The encoding used for parsing the content is either the value specified in the forceEncoding input item, the encoding specified in the XML header or the xmlBinary input item, or UTF-8 (the default encoding, if no encoding is specified).
In text mode, (the default and preferred choice) an XML string is passed as an input item.
In dynamic mode, a choice is offered for input. You can either supply binary or text input. You can use a choice statement and set substitution in the mapping to supply the correct type of input at run time.
When selected, specifies that the output of the activity should be validated against the schema specified in the Output Editor tab.
The following is the input for the activity.
|xmlString||string||The XML string to parse.
This input element is available when the Input Style field in the General tab is set to text.
|xmlBinary||complex||Available when you set the Input Style field in the
This input item contains a required bytes item for which you specify the input XML bytes.
This input item also contains an optional forceEncoding item. This specifies the encoding to use when parsing the XML. If this element is not specified, the encoding specified in the XML header of the byte element is used to parse the XML. If the encoding value is not specified in the XML header, the default encoding (UTF-8) is used.
|xmlBinary|xmlString||choice||Available when the Input Style
General field is set to
You can specify a choice statement and set substitution and supply the correct input type at run time.
The following is the output of the activity.
The Fault tab lists the possible exceptions thrown by this activity.
|XMLParseException||An exception occurred when parsing the data.|
|UnsupportedEncodingException||An unsupported encoding was specified in the forceEncoding input item.|
|MissingByteCountException||An exception occurred while parsing the data with an invalid or missing byte count.|
|ValidationException||The file specifies a version of XML that the parser is not prepared to handle.|