Sign Up
Loading...

XML commands

Use XML commands when a service sends or expects XML documents. They work with the same variable controls as other commands.

Parse XML

Add Parse XML, supply the XML text and choose a mode. SIMPLE is convenient when you need fields from a straightforward document. ORDERED preserves the order of elements and mixed text when that order matters.

Choose Return as, then use the returned value in later commands. Check that the XML matches your expected structure before using fields from an external service.

Generate XML

Add Generate XML and supply the value to turn into XML. Use the same mode as the parsed structure you are working with. The command returns XML text, which you can send as a request body with the appropriate XML content type.

Parsing and generating documents is intended for exchanging data. It does not guarantee that the output text is identical to the original document's spacing, comments or formatting.

Validate XML

Add Validate XML to check whether text is a well-formed XML document before processing it. Its result contains valid and, when available, a helpful message. Use a condition to handle invalid input rather than continuing with missing data.

This checks document structure, not whether the document follows a particular industry schema or business rule. Add your own checks for required fields and accepted values.

Safe documents

Documents are bounded in size and complexity. External references and document-type declarations are rejected rather than fetched. If a partner supplies an unsupported document, ask for a plain data document without external dependencies. Do not use these commands to load files or network resources named inside XML.

Inspect parsed values

For example, parsing <acceptance><status>ok</status><id>001</id></acceptance> in SIMPLE mode keeps the identifier as the text 001. Choose the parsing command's return variable as the function output to inspect its structure in Test.

Related Topics

Loops

In Twidget, loops allow you to execute commands multiple times, either based on a condition or through a set number of iterations. Loops can also be nested, meaning you can run loops within other loops, creating complex logic for your tasks. List Loop. The `List Loop` command enables you to loop thr...

Session Storage

Twidget includes a suite of session storage commands that enable no-code interaction with the browser’s `sessionStorage` API. These tools allow temporary storage of key-value data for the current page session. Purpose. Session storage commands allow developers to manage transient data tied to a sing...

Send Message

Send SMS Command. With Twidget, you can send SMS messages to phones using the `Send SMS` command. This functionality varies depending on the provider. Currently, we support Twilio as the SMS provider. To use Twilio for SMS integrations, you will need: - A Twilio account ID - Twilio Auth Token - A Tw...

Send External HTTP Request

Using Twidget, you can send external HTTP requests effortlessly. This functionality allows you to communicate with external servers or APIs. Below, you will find the necessary parameters and structure to set up an HTTP request. Parameters. - URL: The endpoint to which the request will be sent. - Met...

Conversion

Overview. Twidget's conversion commands allow you to easily convert different data types to the required format. Below is a list of the available conversion commands and examples of how to use them. The `Convert to Text` command converts the provided value to a text (string) format. Examples: - `123...