Table of Contents

Sample Robotic Automation solution: xmlDocumentComponent with schema

This sample solution shows how to use the xmlDocumentComponent component with an external schema in Pega Robot Studio.

Project items

  • Windows form: Windows form1
  • Automation: LoadDocument
  • Automation: UpdatePublishers
  • Automation: ValidateSchema

Automation details

LoadDocument

This automation contains the logic to be performed when various buttons on the form are clicked:

  • When you click the Load button, the automation opens the XML file specified in the txtFileName text box and and displays the contents in the txtXML text box.
  • When you click the Select button, the automation displays the child nodes, InnexText, and other details depending on the XPath specified in the txtSelectedXML text box.

UpdatePublishers

This automation contains the following group boxes: Append Publishers, Prepend Publishers, and Insert Publishers.

  • In the Append Publishers group box, when you click the Append Child button from the Publisher Operations tab, the automation appends the Publisher Info at the end of the XML file.
  • In the Prepend Publishers group box, when you click the Prepend Child button from the Publisher Operations tab, the automation prepends the Publisher Info at the start of the XML file.
  • In the Insert Publishers group box, when you click the Insert button from the Publisher Operations tab, the automation inserts the Publisher Info at the index location mentioned in the txtPublisherIndex text box.

ValidateSchema

When you click the Validate button, the XML document is validated with reference to the XSD document that is used. The validation errors are displayed if any are found. For more information and instructions on how to build the automation, see Using the xmlDocumentComponent with schema.

You can download completed solutions for each version by using the links in the following table:

Studio version Built by using this build Sample solution download
8.0 8.0.1037 xmlDocumentComponent with schema 8.0
8.0.SP1 8.0.2037 xmlDocumentComponent with schema 8.0 SP1
19.1 19.1.2.0 xmlDocumentComponent with schema 19.1
Suggest Edit

100% found this useful

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.