Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 10th, 2010, 06:33 AM
Authorized User
 
Join Date: Oct 2010
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Default Loading XML file

Hello everybody
I have taken more hours to do this
but it is not work, i want to try to get ID from datbase
This is my code

function createMarker(point, index, html)
{
// var letter = String.fromCharCode("A".charCodeAt(0) + index);
var letteredIcon = new GIcon(icon0);
var geticon=new GIcon(baseIcon);
var ID= <%=GetHotelID %>; // get ID from database
ID=parseInt(ID);
var locations = xmlDoc.documentElement.getElementsByTagName("locat ion");
var m;
var hotelids = xmlDoc.getElementsByTagName("hotelid");
var hnames = xmlDoc.getElementsByTagName("hname");
for (m=0;m<locations.length;m=m+1)
{

var hotelid = parseInt(hotelids[m].firstChild.nodeValue);
var hotelname = hnames[m].firstChild.nodeValue;
alert(hotelid +'=' + ID ) ;
if (hotelid=ID) //compare hotelid with ID to appeare
{
var marker = new GMarker(point, letteredIcon);
}
else
{
var marker = new GMarker(point, geticon);
}
}
GEvent.addListener(marker, "mouseover", function()
{ marker.openInfoWindowHtml(html); }
);
markerList[index] = {marker:marker, html:html};
return marker;

}
================
XML File
<locations>

<location>
<hotelid>1</hotelid>
<MapName>Novotel Hotel Nha Trang</MapName>
<hname>novotel Nha trang</hname>
<provincename>Nha Trang</provincename>
<himage>True</himage>
<Latitude>12.2376877047603</Latitude>
<Longitude>109.196698665619</Longitude>
</location>

<location>
<hotelid>2</hotelid>
<MapName>Yasaka</MapName>
<hname>Yasaka Saigon Nha Trang</hname>
<provincename>Nha Trang</provincename>
<himage>True</himage>
<Latitude>12.2490637295063</Latitude>
<Longitude>109.196248054504</Longitude>
</location>

<location>
<hotelid>6</hotelid>
<MapName>Sunrise Hotel</MapName>
<hname>Sunrise Hotel</hname>
<provincename>Nha Trang</provincename>
<himage>True</himage>
<Latitude>12.2508041656292</Latitude>
<Longitude>109.196194410324</Longitude>
</location>

<location>
<hotelid>7</hotelid>
<MapName>Diamond Bay Resort</MapName>
<hname>Diamond Bay Resort and Golf</hname>
<provincename>Nha Trang</provincename>
<himage>True</himage>
<Latitude>12.1700715221296</Latitude>
<Longitude>109.190883636475</Longitude>
</location>
</locations>
Thanks in advance
  #2 (permalink)  
Old November 17th, 2010, 05:33 AM
Authorized User
 
Join Date: Oct 2010
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Default

I think i have found out it
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in loading XML. nikhil_vaghela XML 3 May 15th, 2008 08:19 AM
Loading XML files in XSLT newbieboobers XSLT 2 March 12th, 2008 11:42 AM
loading XML Documents in IFrame in IE 5.0 anil_tiwari Javascript 1 February 2nd, 2006 08:01 PM
Xml Dcument not loading bearpaws XML 3 November 14th, 2003 01:29 PM



All times are GMT -4. The time now is 11:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.