Working with Client Data

This sample shows how to use the ClientData property, and handle XML using Microsoft DOMDocument Object. You can use any XML parser to work with the XML data. In the sample we print the STREETNAME attribute field in the object’s ClientData.

 

<HTML>

<b>ClientData Sample</b></br>

This sample shows how to use the ClientData property,

and the handling of XML using Microsoft DOMDocument Object.</br>

 

<SCRIPT Language="VBSCRIPT">

Dim IInfoTree

 

sub PrintClientData(TerraExplorerObject)

Dim XMLobj

Dim snode

'Create XML DOMDocument

Set XMLobj = CreateObject("MSXML.DOMDocument")

XMLobj.loadXML TerraExplorerObject.ClientData

Set snode = XMLobj.selectSingleNode("FieldsData/STREETNAME")

MsgBox snode.Text

end sub

 

sub FindObject()

'Find the selected Object in the InformationTree

Set IInfoTree = TE.interface("IInformationTree5")

ItemID = IInfoTree.GetNextItem (0,10)

Set TerraExplorerObject = IInfoTree.GetObjectEx (ItemID, “”)

PrintClientData (TerraExplorerObject)

end sub

</SCRIPT>

 

<INPUT type=button value="Print ClientData" name="Print ClientData" onclick="FindObject()"></br>

 

<BODY>

<OBJECT ID="TE" CLASSID="CLSID:3a4f9191-65a8-11d5-85c1-0001023952c1"></OBJECT>

</BODY>

 

</HTML>