|
| XML Validation Functions : | Function Index |
|
|
Note: To know the appropriate xml expression to be used for xpath in the below functions, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html |
Function Description:
To check whether the specified node contains the given value in the XML file.
How to Define:
doesNodeContainValue(xmlfile,expression(xpath))
xml file = Valid XML file path.
xpath = Valid xpath.
Return Value:
0 for Success
1 for Failure
Function Description:
To get the node attributes from the specified XML file.
How to Define:
getNodeAttributes(xmlfile,expression(xpath))
xml file = Valid XML file path.
xmlpath = Valid xpath.
Example:
result = getTextNodeAttributes("C:/test/QEngineWebTest/xmlvalid/update_conf.xml","/properties/Log/Class")
You can verify the output of the function by iterating through the returned object.
for i in range(0,len(result)):
for j in range(0,len(result[0])):
displayMessage(result[i][j])
Return Value:
String Array
Function Description:
To get the node count from the specified XML file.
How to Define:
geNodeCount(xmlfile,expression(xpath))
xml file = Valid XML file path.
xmlpath = Valid xpath.
Return Value:
Integer
Function Description:
To get the node value from the specified XML file.
How to Define:
getNodeValue(xmlfile,expression(xpath))
xml file = Valid XML file path.
xmlpath = Valid xpath.
Return Value:
String
Function Description:
To get the node values from the specified XML file.
How to Define:
getNodeValues(xmlfile,expression(xpath))
xml file = Valid XML file path.
xmlpath = Valid xpath.
Example:
result = getNodeValues("C:/test/QEngineWebTest/xmlvalid/update_conf.xml","/properties/Log/Class")
You can verify the output of the function by iterating through the returned object.
for i in range(0,len(result)):
for j in range(0,len(result[0])):
displayMessage(result[i][j])
Return Value:
String array
Function Description:
To get the text node values from the specified XML file
How to Define:
getTextNodeValues(xmlfile,expression(xpath))
xml file = Valid XML file path.
xmlpath = Valid xpath.
Example:
result = getTextNodeValues("C:/test/QEngineWebTest/xmlvalid/update_conf.xml","/properties/Log/Class")
You can verify the output of the function by iterating through the returned object.
for i in range(0,len(result)):
for j in range(0,len(result[0])):
displayMessage(result[i][j])
Return Value:
String array
Function Description:
To check whether the specified node is present in the XML file.
How to Define:
isNodePresent(xmlfile,expression(xpath))
xml file = xpath.alid XML file path.
xmlpath = Valid xpath.
Return Value:
0 for Success
1 for Failure
Function Description:
To check whether the two XML files has the same set of node values in the same order.
How to Define:
isXMLIdentical(xmlfile,expression(xpath))
xml file = xpath.alid XML file path.
xmlpath = Valid xpath.
Return Value:
0 for Success
1 for Failure
Function Description:
To check whether the two XML files has the same set of node values wherein the order can differ.
How to Define:
isXMLSimilar(xmlfile,expression(xpath))
xml file = Valid XML file path.
xmlpath = Valid xpath.
Return Value:
0 for Success
1 for Failure
|