HELP URGENT...Please please
ok, I am working with asp and xml.
I have hundreds of file similar to sample1 and sample2 (same xml structures). I am able to display the content of the xml file. However, what I am having problmes is with sample1. I want to be able to redirect to the link provided (as you see in sample1) when the <item-content> xml tags contains a link. If the xml file contains <html> tags (sample2) I want just to be able to display content.
Right now the pages below just display the content of the xml files.
--- main.asp ------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href="getPage.asp?item=sample1.xml">sample1</a>
<a href="getPage.asp?item=sample2.xml">sample2</a>
</body>
</html>
---- sample1.xml --------------------------------
<?xml version="1.0"?>
<!DOCTYPE SEND_ITEM_DETAILS>
<LIFE>
<item>
<item-id>9396</item-id>
<item-content> Group&SESSION=6767530564965005</item-content>
</item>
</life>
--- sample2.xml -----------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE SEND_ITEM_DETAILS>
<LIFE>
<item>
<item-id>11989</item-id>
<item-content>
<html>
<head>
<title>Relapse</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">Question: When is
the most typical time that most smokers relapse when they try to stop?</font>
</h4>
<p><font face="Arial, Helvetica, sans-serif" size="2">The majority of smokers
relapse in the first few days (days 1-3). </font>
</p>
</body>
</html>
</item-content>
</item>
</life>
--- getPage.asp -------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<script>
//get parameter
var xTempItem
mainURL = window.location.search;
URLparts = mainURL.split('?');
Arguments = URLparts[1].split('&');
for (i in Arguments) {
pair = Arguments.split('=');
xTempItem = pair[1]
}
//get text
var strResponse
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("GET", xTempItem, false);
xmlhttp.send();
xmlhttp.responseText;
document.write(xmlhttp.responseText);
</script>
ok, I am working with asp and xml.
I have hundreds of file similar to sample1 and sample2 (same xml structures). I am able to display the content of the xml file. However, what I am having problmes is with sample1. I want to be able to redirect to the link provided (as you see in sample1) when the <item-content> xml tags contains a link. If the xml file contains <html> tags (sample2) I want just to be able to display content.
Right now the pages below just display the content of the xml files.
--- main.asp ------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href="getPage.asp?item=sample1.xml">sample1</a>
<a href="getPage.asp?item=sample2.xml">sample2</a>
</body>
</html>
---- sample1.xml --------------------------------
<?xml version="1.0"?>
<!DOCTYPE SEND_ITEM_DETAILS>
<LIFE>
<item>
<item-id>9396</item-id>
<item-content> Group&SESSION=6767530564965005</item-content>
</item>
</life>
--- sample2.xml -----------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE SEND_ITEM_DETAILS>
<LIFE>
<item>
<item-id>11989</item-id>
<item-content>
<html>
<head>
<title>Relapse</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">Question: When is
the most typical time that most smokers relapse when they try to stop?</font>
</h4>
<p><font face="Arial, Helvetica, sans-serif" size="2">The majority of smokers
relapse in the first few days (days 1-3). </font>
</p>
</body>
</html>
</item-content>
</item>
</life>
--- getPage.asp -------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<script>
//get parameter
var xTempItem
mainURL = window.location.search;
URLparts = mainURL.split('?');
Arguments = URLparts[1].split('&');
for (i in Arguments) {
pair = Arguments.split('=');
xTempItem = pair[1]
}
//get text
var strResponse
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("GET", xTempItem, false);
xmlhttp.send();
xmlhttp.responseText;
document.write(xmlhttp.responseText);
</script>