Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

XMLSplitter can be used to split XML documents based on the configured XPath. This component is useful when there are repeated elements in the documents that can be processed by independently by subsequent components.

...

Post Processing XSL configuration can be used to transform the response message before sending it to the output port.

...

Namespace prefixes that are used instead of the complete namespace in XPath expression can be specified by clicking the ellipsis button  against this property which opens a Namespaces table as shown in Ffigure 2. The namespaces present in the input schema, if any, are automatically populated in the table. If the user wants to provide XPaths manually and use the namespaces which are not present in the schema provided, they can be added using the namespaces tab

...

Operations that can be performed in the namespace table are:

  • Add
     
    Namespaces present in the schema provided against property Schema are populated by default in the table. To use any namespaces that are not present in that schema, this option can be used. When the add button is clicked, a new namespace will be added with default prefix and URI. The columns are editable and thus an appropriate value can be specified in place of the default values.
  • Delete
    Existing namespaces can be deleted from the table using this option. When namespaces are fetched from connected components or some XSD, there is a possibility that namespaces with the same URI are added with a different namespace prefix. In such cases, redundant namespaces can be deleted. This will not affect the schemas in which the namespaces are present.
  • Delete all
    Deletes all the namespaces in the table.
  • Fetch
    Fetches namespaces from the schemas present on ports of other components connected to XMLSplitter component. Thus it is advisable to configure the connected components completely before using this option.
  • Load XSD
    Loads namespaces from the schema which is provided in the text editor opened when this button is clicked. This option can be used when there are XSDs whose namespaces are required for configuration. One schema must be loaded a time. The schemas are not stored in the component.

...

Namespace for the root element in output XML(s). If the default value is selected, then the root element namespace will be the same as the target namespace of the input XSD provided. This property will be visible when the Operation is selected as Group.

Note

If an element is selected using property XPath, then those elements having the same value will be grouped. If an attribute is selected as XPath, then those elements for which this attribute is defined and having the same value for this attribute will be grouped.

Example: If the input contains all the Employees' details conforming to the schema shown in figure 4 and if it is required to group individual employee details which are in the same group (group information is stored in the attribute Group of Employee element), then configure 'XPath' to ns1:Employee_Schema/ns1:Employee/@Group and choose property 'Operation' as Group. Employee elements whose group attribute is the same will be combined into a single message.


Figure 5: Schema for Employees details with a group attribute

...

Schema for the output message can be specified. Schema The schema can be specified exclusively or can be generated with the help of input schema and XPath by clicking Get schema based on input and XPath button in the schema editor. This is not guaranteed to give a valid schema always. Please verify when using this feature.

...

If set to 'yes', the Workflow Instance ID will be removed and after encountering the next workflowItem config, WorkFlow_Instance_ID will be addded added automatically with a new value, making split messages with unique IDs.

...


Figure 8: configuration for scenario 1

Use feeder Feeder and display component Display components to send sample input and to check the response respectively. In the example given below, the Split element selected is Author.

...

Grouping the Input XML based on the XPath provided.

Configure the XMLSplitter Configure XMLSplitter as described in Configuration and Testing section. The configuration for this example is shown below. In the example given below, the Xpath element selected is  /ns1:BookStore/ns1:Book/ns1:Title  and Group is selected as /ns1:BookStore/ns1:Book.

This operation splits the XML by the path configured for the Group and accommodates all the messages having the same Xpath value into a single message under the value configured for the group. So, the number of messages dependdepends upon the number of distinct values configured for XPath.

...

  • The output schema can be computed from the input schema and the XPath used to split the XML document using the Get Schema based on Input and XPath  button in the schema editor for property OutputSchema. This is not guaranteed to give a valid schema always. Please verify when using this feature.
  • Prefer XSLT for simple split paths and XPath for complex paths. All kinds of split paths may not be supported by XSLT.
  • When component configuration sends multiple messages, messages contain the following JMS properties to identify first and last messages.
    • First document: START_EVENT=true
    • All documents: RECORD_INDEX=<index of output message>
    • Last document: CLOSE_EVENT=true
  • When the input XML does not contain the element specified at Xpath, splitting/grouping is not performed and there will be no output messages in this case.
  • The output generated has the same instance id for all the split elements. This causes issues when document tracking, if you try to track both documents on the output of the splitter, you only get a single entry (due to the duplicate instance ID's).
  • To have different Instance Ids for different documents, workflow items in the flow have to be set properly.
  • The Instance ID is set at the first "Workflow Item" encountered in the event process, so if the 1st workflow item is set before OUT_PORT of XMLSplitter then there will be only one "Instance ID" for all splitted split messages, however, all splitted split messages can have different "Document ID". On the other hand, if the first "Workflow Item" is set at OUT_PORT of XMLSplitter each element will have a different "Instance ID".

...

Adaptavist ThemeBuilder EngineAtlassian Confluence