Importing XML using the Parse Action

Action: Parse

M/DB:X is unusual in that it does not use a validating XML parser. It will attempt to tidy up any XML or HTML that you import into it, and will construct its best attempt at a corresponding DOM from what it is given. This lenient parsing makes it ideal for importing "lazily"-specified HTML which you can then analyse, search and manipulate as a correctly-structured XML document.

Note 1: this lenient parsing does mean that the DOM constructed by M/DB:X may differ from what you expected when you imported a document, particularly if your document contains mismatched tags. However if M/DB:X is given a properly structured XML document, then it will accurately parse it and create a corresponding DOM.

Note 2: M/DB:X will validate JSON input and will reject it if it finds syntax errors

Action-specific name/value pairs:

Parameter Name Description
DocumentName The name that you want assigned to the document if parsing completes successfully. If a document of the same name exists in M/DB:X, it will be automatically deleted. The name is case-sensitive.
XML String of XML to import into M/DB:X as a new document. Note that the XML must be correctly URL-escaped.

Must not be present if JSON specified as an input.
JSON JSON string to import into M/DB:X where it will be converted to a new XML document. Note that the JSON must be correctly URL-escaped if necessary.

Must not be present if XML specified as an input.

Example Request

XML Input

&MDBAccessKeyId=[your access key id]
&Signature=[computed signature]

JSON Input

&MDBAccessKeyId=[your access key id]
&Signature=[computed signature]

In this example, the JSON input is:


The resulting XML DOM that M/DB:X will create and store is:


Example Response


<?xml version='1.0'?>
<ParseResponse xmlns="">

The XML was parsed without error and a DOM created with a DocumentOID of "6-1" and DocumentName of "myExample"

JSON (ie if OutputFormat=JSON specified in the Request)


The JSON was parsed without error and converted to an XML DOM with a DocumentOID of "8-1" and DocumentName of "myJSONExample"