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.

Related Topics

Advanced file commands

Prepare CSV downloads, work with small ZIP archives and share a temporary download link from an endpoint, server function or event. Find these commands under File Manager when adding a command. Use the usual variable selector and Return as field. The existing file commands still handle storage, fold...

Math

Twidget offers a variety of commands to manipulate numbers. Below are the math commands available, along with their descriptions, inputs, and outputs. Sum. Description: Adds together a list of numbers and returns the sum. - Inputs: - `numbers`: A list of numbers to be added together. - Output: A sin...

Security

Twidget provides several built-in functions to enhance the security of your applications. Below is an overview of each security command, including its description, inputs, and outputs. For checksums, shared-secret signatures, webhook verification and safe text comparison, see [Cryptography commands]...

Date

Twidget offers a variety of commands to manipulate date objects. Below are the available commands along with their respective descriptions, inputs, and outputs. Current Date. Description: Returns the current date and time. Output: - Type: DATE Add Time. Description: Returns the date plus a specified...

Cache

Cache values let an endpoint, server function or event reuse temporary data. For example, save a product summary for five minutes instead of requesting it from another service every time. A cache is temporary. Keep permanent records in your database and make sure the workflow can obtain the original...