<%@ Language=JavaScript%>
<%Response.Buffer = true%>
<html>
<head>
<title>Buildings</title>
</head>
<body text="#000000" vlink="#993399" link="#003399" bgcolor="#999999" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<form action="MenuTest.asp" method="get" name="frmThis">
<tr>
<td>
<%
try{
// Consts
var FAKE_MENU = "<?xml version=\"1.0\"?><Menus><M
enu><Title
>Menu Title One</Title><MenuItem><Titl
e>Menu Item 1</Title><URL>
http://menu.com</URL><
/MenuItem>
<MenuItem>
<Title>Men
u Item 2</Title><URL>
http://fakeurl.com</UR
L></MenuIt
em></Menu>
<Menu><Tit
le>Menu Title Two</Title><MenuItem><Titl
e>Menu Two Item 1</Title><URL>
http://menu.com</URL><
/MenuItem>
<MenuItem>
<Title>Men
u Two Item 2</Title><URL>
http://fakeurl.com</UR
L></MenuIt
em></Menu>
</Menus>";
var FAKE_CONTENT = "<?xml version=\"1.0\"?><Content>
<Employee>
<Name>Bob Smith</Name></Employee></C
ontent>";
// Vars
var menuDoc = Server.CreateObject("MSXML
2.DOMDocum
ent");
var contentDoc = Server.CreateObject("MSXML
2.DOMDocum
ent");
var mergedDoc = Server.CreateObject("MSXML
2.DOMDocum
ent");
var styleDoc = Server.CreateObject("MSXML
2.DOMDocum
ent");
menuDoc.async = false;
contentDoc.async = false;
mergedDoc.async = false;
styleDoc.async = false;
// Load the XML which will come from database in the future.
Response.Write(menuDoc.loa
dXML(FAKE_
MENU));
Response.Write(contentDoc.
loadXML(FA
KE_CONTENT
));
// Merge the menus and the page content.
Response.Write(mergedDoc.l
oadXML("<?
xml version=\"1.0\"?><Root>" +
menuDoc.documentElement.xm
l + contentDoc.documentElement
.xml + "</Root>"));
// Load the style sheet.
styleDoc.load(Server.Mappa
th("MenuTe
st.xsl"));
// Output the HMTL produced by applying the style sheet.
Response.Write(mergedDoc.t
ransformNo
de(styleDo
c));
}catch(e){
Response.Write(String(e.de
scription)
);
}
%>
</form>
</td>
</tr>
</table>
</body>
</html>