XML Adaptor
Introduction
XML adaptor allow you to interact with a .xml file, offering a set of Predefined Functions so that you can retrieve, check and modify the content of the file. It also allows to save the modified document.
Initilization Parameters
-
FilePath:FilePath:Completecomplete path of the file
Predefined Functions (PF):
-
generateFileAsEvidence():
Thethe function generates a copy of the XML file in that moment, to be added as evidence. It does not require input parameters.
-
getElementAttrTextByXPath(XPath,Attribute Name):
Returnsreturns element attribute text, searching by XPath and attribute name.
-
getElementTextByTagName(Tag Name, Position):
Returnsreturns element text, searching by Tag name and Position.
-
getElementTextByXPath(XPath, Position):
Returnsreturns element text, searching by XPath and Position.
-
getElementsCountByTagName(Tag Name):
Returnsreturns the number of occurrences of the element, searching by Tag name.
-
getElementsCountByXPath(XPath):
Returnsreturns the number of occurrences of the element, searching by XPath.
-
getElementsTextByTagName(Tag Name):
Returnsreturns Array string of elements text, searching by Tag name.
-
getElementsTextByXPath(XPath):
Returnsreturns Array string of elements text, searching by XPath.
-
replaceElementAttrTextByXPath:
Replacesreplaces the element attribute text, searching by Xpath and attribute name.
-
replaceElementTextByTagName(Tag Name, Position, New Text):
Replacesreplaces the Element´s text, searching by Tag Name and Position.
-
replaceElementTextByXPath:
Replacesreplaces the element text, searching by Xpath and Position.
-
saveAs:
Savessaves XML to the user path. Saves to the log folder if the path is not specified.
-
saveXML():
Savessaves the .xml file in the original path.
-
xmlToString:
Savesave XML from the application memory to a String.