UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Absent Member.
Absent Member.
384 views

how to create an XMLWareHouse Dynamically in QTP 9.2

Hi All,

i am working with XMLWarehouse in QTP 9.2, i have requirement that i need to create the xml structures at runtime, has any one got any suggestion on this

Thanks
Krishna Kishore
Think beyond frontier
0 Likes
1 Reply
Absent Member.
Absent Member.

Use these functions.
Function NewDoc(ByVal RootName)
Dim oDoc
Set oDoc = createObject("MSXML2.DOMDocument.4.0")
oDoc.LoadXML("<" & RootName & ">")
Set NewDoc = oDoc
End Function
Function addElement(ByVal oNode, ByVal Name, ByVal Text)
Dim oElement'as MSXML2.IXMLDOMElement
Set oElement = oNode.ownerDocument.createElement(Name)
oElement.text = Text
oNode.appendChild(oElement)
Set addElement = oElement
End function
Function addNode(ByVal oNode, ByVal Name)
Dim oNewNode'as MSXML2.IXMLDOMNode
Set oNewNode = oNode.ownerDocument.createElement(Name)
oNode.appendChild(oNewNode)
Set addNode = oNewNode
End Function
Function addAttribute(ByVal oNode, ByVal Name, ByVal Value)
Dim oAttribute'as MSXML2.IXMLDOMAttribute
Set oAttribute = oNode.ownerDocument.createAttribute(Name)
oAttribute.Value = Value
oNode.setAttributeNode(oAttribute)
Set addAttribute = oAttribute
End Function
Ravi
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.