XML Handling Functions

This topic provides you with information related to XML functions.

This page discusses:

CreateHTTPClient

You can create an HTTP Client.

Signature

CreateHTTPClient() : HTTPClient

ReturnType

HTTPClient

CreateJSONDocument

This function creates an object of the JSON Document (JavaScript Object Notation) type. A JSON document can be used read/Modify JSON Document from a database as well as from a disk.

Signature

CreateJSONDocument(iJSONDocument : ObjectType) : JSONDocument

Arguments

Name Input/Output Required? Type Comment
JSON Document Out Yes JSONDocument The created json document.
iJSONDocument In Yes ObjectType The path from where document is read.

ReturnType

JSONDocument

Example

// Creates JSON Document while reading data from a file path
let jsonDoc(jsonDocument)
jsonDoc = CreateJSONDocument("F:\json_doc_volatile.json")

// Creates JSON Document while reading data from a PLMDocument
let plmDoc(PLMDMTDocument)
let plmBasedJSONdoc(JSONDocument)

plmDoc = AccessResource("JSON DOC","PLMDMTDocument")

if plmDoc <> NULL
{
plmBasedJSONdoc = CreateJSONDocument(plmDoc)
if plmBasedJSONdoc <> NULL
{
    	let jnode (JsonNode)
	jnode = plmBasedJSONdoc.Root
	jnode.Stringify()
}
}

CreateXMLDocument

This function lets you load an empty document created using the new function or load a document saved on disk or in database.

Signature

CreateXMLDocument(iXMLDocument : ObjectType [, iWithValidation : Boolean, iSchema : ObjectType, iNamespace : String]) : XMLDocument

Arguments

Name Input / Output Required? Type Comment
iXMLDocument In ObjectType
  • Path of the XML source document.
  • PLMDMTDocument
  • Logical name (ARM table).
iWithValidation In No Boolean Checks that the file complies with the schema.
iSchema In No ObjectType
  • Path of the XML source document.
  • PLMDMTDocument
  • Logical name (ARM table).
iNamespace In No String

ReturnType

XMLDocument

Example

xmlReferenceDoc = CreateXMLDocument("e:\\XmlSample.xml")