-
Contributing Member
XML Repository
Hi All,
Can you please help me with XML Repository, when do we use XML Repository and how will it be useful in DP? Can you please give an example of how we can implement and use it?
Regards,
Tina.
-
Expert Member
Re: XML Repository
Hi Tina,
The advantage of using an XML based repository is that you can easily migrate your repository across machines for different projects.
Incase we use a DB to store Objects, it becomes mandatory for us to have the Db software installed on all machines. But since XML is a freeware you can implement the same across networks.
Export your Shared Repository to XML foramt. Navigate to Object repository manager and select the "Export to XML" option.
Working with XML Repository.
In order to work with XML based repository, we need to be comfortable with XML based DOM programming. Each object would be treated as an Element and Object Properties would be treated as Attributes.
We would need to code in somewhat similar lines to read from a XML Repository.
Dim oNodeValueList()
'dim count
'count = 0
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("C:\Google.xml")
set NodeList = xmlDoc.getElementsbyTagName("qtpRep:Object")
oNodeListLength = NodeList.length
redim oNodeValueList(oNodeListLength)
for i = 0 to oNodeListLength
'Set oNodeList = xmlDoc.getElementsbyTagName("qtpRep:Property").item(i).Text
sValue = NodeList.item(i).text
oNodeValueList(i) = sValue
msgbox oNodeValueList(i)
next
The above code basically would read all Objects and display their Properties serially.
Once you have Object Types (Class) and properties extracted, we could use the same as part of DP programming on following lines -
Set objDesc = Description.Create()
objDesc("PropertyName").value = "PropertyValue"
Browser("micClass:=Browser").Page("micClass:=Page").webEdit(ObjDesc).set ***
I hope this clears things a bit...
Cheers...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules