xml handling

kelum
07-13-2004, 04:19 AM
hi,
in my map i have several objects.each object has a id.
then i hava separate xml file containg data about each and every object.one tag contains the id field to identify the object.
when i click on the particular object i want to display those data.
is there any way to do this with svg.
have we use to any client side or server side scripting?
pls send your suggestions
regards,
kelum.

Anonymous
07-13-2004, 05:52 AM
You can with getURL and parseXML get your xml nodes.
You can append this nodes to your svg.

On click, you can client side find data and display them.

You can also add your data as parameter of your choice to your svg tag and display them.

Michel

kelum
07-15-2004, 06:46 AM
as you mentioned above i add the xml to existing node like below.
this xml contains
<objectInfo id='objectData'>
<object id='aaa'>
<name>Empire Burlesque</name>
<address>Bob Dylan</address>
</object>
</objectInfo>

function getObjects()
{
svgdoc4 = evt.target.ownerDocument
getURL("objectInfo.xml",callback1)

}
function callback1(data)
{
if (data.success)
{
object_node= parseXML(data.content,svgdoc4)

svgdoc4.getElementById("base").appendChild(object_node)

}

}

then i try to retrive this.it will give errors.

function getObjectInfo(evt){
getObjects()

svgdoc3 =evt.target.ownerDocument

//retreive data from added xml
cnodes=svgdoc3.getElementById("objectData").childNodes
nodeVal=cnodes.item[0].getAttributeNS(null,"id")

//display
idVal = svgdoc3.getElementById("idVal");
idVal =idVal.getFirstChild();
idVal.setData(nodeVal)


}

Anonymous
01-13-2005, 02:10 AM
I am having the same problem have reched anything yet....
please if yea,,,,mail me
shourbagui@gmail.com
or
amshourbagui@yahoo.com with the svg developers group

Anonymous
01-13-2005, 02:22 AM
Problem is here :
nodeVal=cnodes.item[0].getAttributeNS(null,"id")
First use item() and not item[]
Second in ASV, linefeed is a child so cnodes.item(0) is linefeed ...
Use id of child or use nextSibling

Michel

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum