Hello Everyone, I am very new to xml...I am have about 500 xml files like fileOne and fileTwo below..They have same schema. Some
of the file only contains a website in the <item-content> as you can see i fileOne. The other contains html with in xml...What I am
tryin to do is when I click in one of the links in other pages. It calls the asp page below and the content gets display. This works just fine.
However, I need to be able to redirect the page if the value of <item-content> is a web addresss. Otherwise,I just need display the content.
---asp page
<script type="text/javascript">
var tempItem
tempItem = " items/" + displayItem('item')
var strResponse
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("GET", tempItem, false);
xmlhttp.send();
xmlhttp.responseText;
document.write(xmlhttp.responseText);
<script>
-----xml file One
<?xml version="1.0"?>
<LIFE>
<item>
<item-id>12162</item-id>
<item-content></item>
</LIFE>
-----xml file Two
<?xml version="1.0"?>
<LIFE><item>
<item-id>12082</item-id>
<item-content>
<html>
<head>
<title>Reasons to Stop Smoking</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<h4><font face="Arial, Helvetica, sans-serif" color="#324987"> Reasons to Stop
Smoking</font></h4>
<p><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">There are
a lot of good reasons to stop smoking. Here are just a few to help you get started.</font></p>
<ul><font color="189B6F">
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Bad breath
and stained teeth </font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Bad smell
in clothes and hair and on skin <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Decreased
athletic ability <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Cough
and sore throat <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Faster
heartbeat and raised blood pressure <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Risk of
passive smoking to people around you <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Cost of
cigarettes</font></li>
</font></ul>
<p><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Check out
our <b>StayQuit</b> stop smoking program to learn more. </font></p>
<p>? </p>
</body>
</html>
</item-content>
</item>
</LIFE>
of the file only contains a website in the <item-content> as you can see i fileOne. The other contains html with in xml...What I am
tryin to do is when I click in one of the links in other pages. It calls the asp page below and the content gets display. This works just fine.
However, I need to be able to redirect the page if the value of <item-content> is a web addresss. Otherwise,I just need display the content.
---asp page
<script type="text/javascript">
var tempItem
tempItem = " items/" + displayItem('item')
var strResponse
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("GET", tempItem, false);
xmlhttp.send();
xmlhttp.responseText;
document.write(xmlhttp.responseText);
<script>
-----xml file One
<?xml version="1.0"?>
<LIFE>
<item>
<item-id>12162</item-id>
<item-content></item>
</LIFE>
-----xml file Two
<?xml version="1.0"?>
<LIFE><item>
<item-id>12082</item-id>
<item-content>
<html>
<head>
<title>Reasons to Stop Smoking</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<h4><font face="Arial, Helvetica, sans-serif" color="#324987"> Reasons to Stop
Smoking</font></h4>
<p><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">There are
a lot of good reasons to stop smoking. Here are just a few to help you get started.</font></p>
<ul><font color="189B6F">
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Bad breath
and stained teeth </font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Bad smell
in clothes and hair and on skin <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Decreased
athletic ability <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Cough
and sore throat <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Faster
heartbeat and raised blood pressure <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Risk of
passive smoking to people around you <br>
</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Cost of
cigarettes</font></li>
</font></ul>
<p><font face="Arial, Helvetica, sans-serif" size="2" color="189B6F">Check out
our <b>StayQuit</b> stop smoking program to learn more. </font></p>
<p>? </p>
</body>
</html>
</item-content>
</item>
</LIFE>