views:

80

answers:

1

Help me for create a xml, based on Room Count of hotel

For example: I have 5 Rooms: Room1, Room2, Room3, Room4 and Room5.

In Room1: 2 Adults, 1 Child, Age 6
In Room2: 1 Adult, 0 Child
In Room3: 2 Adults, 2 Child, Age 6, Age 7
In Room4: 1 Adult, 0 Child
In Room5: 2 Adult, 1 Child, Age 6
  1. If Child is 0 and Adult count comes same ( here the example adult count is 1), we take that rooms in one ( as 2 rooms). Other rooms in different .
<%
XMLLIST =”<Hotel>”&_
   “<RoomList>”&_
   “<Room>”&_
“<RoomCount>2</RoomCount>”&_
“<Adults>1</Adults>”&_
“<Child>0</Child>”&_
   “</Room>”&_

“<Room>”&_
“<RoomCount>1</RoomCount>”&_
“<Adults>2</Adults>”&_
“<Child>1</Child>”&_
“<Age>6</Age>”&_
   “</Room>”&_
“<Room>”&_
“<RoomCount>1</RoomCount>”&_
“<Adults>2</Adults>”&_
“<Child>2</Child>”&_
“<Age>6</Age>”&_
“<Age>7</Age>”&_
   “</Room>”&_
“<Room>”&_
“<RoomCount>1</RoomCount>”&_
“<Adults>2</Adults>”&_
“<Child>1</Child>”&_
“<Age>6</Age>”&_
   “</Room>”&_
   “</RoomList>”&_
   “</Hotel>”
%>

Plz help me to create a loop in asp code for create .

A: 

Check out Gelatin for converting text files to XML. (Note that what you posted isn't XML though.)

knipknap