Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl page not writing correct data from xml page

Status
Not open for further replies.

BeckD

Programmer
Apr 16, 2002
53
GB
Hi

I'm having the bizzarrest problem ever. I have an asp page which dynamically writes xml - test_xml.asp. I have an xsl page which displays the data from the xml - test.xsl. I have a third page called test.asp which parses both the xml and the xsl pages.

test_xml.asp
Code:
<!--METADATA TYPE=&quot;typelib&quot; FILE = &quot;C:\Program Files\Common Files\System\ADO\msado15.dll&quot; -->
<%@ Language=VBScript %>
<%
Option Explicit

Response.ContentType = &quot;text/xml&quot;
Response.Expires = 0
Response.Buffer = True

Main

Sub Main()
	
	response.write &quot;<?xml version='1.0'?>&quot; & vbNewLine
	response.write &quot;<page>&quot; & vbNewLine	
	response.write vbtab & &quot;<ipaddress>&quot;& Request.ServerVariables(&quot;remote_host&quot;) &&quot;</ipaddress>&quot; & vbNewLine
	response.write &quot;</page>&quot;
	
End Sub
%>

test.xsl:
Code:
<?xml version=&quot;1.0&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform&quot;>[/URL]
<xsl:output method=&quot;html&quot;/>

	<xsl:template match=&quot;/&quot;>
	<html>
		<head>
			<title>Test</title>
			<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; />
		</head>
		<body>
		
		<xsl:value-of select=&quot;page/ipaddress&quot;/>		
		</body>
	</html>
	</xsl:template>

</xsl:stylesheet>

Nothing too complicated about either of these pages. BUT! When you run test.asp the IP address shown is that of my server - as if it was looking at the Local_Addr server variable. Curiouser and curiouser - when you look at the xml produced the ip address is that of my client pc (which is what I want).

How is it possible for the xsl page to show the server ip when the xml page is giving the xsl page the client ip? Where is the xsl page getting the server ip from??? Are there little gremlins inside my computer????

Any help/suggestions much appreciated.
Beck
 
Thanks flumpy, as it happens what I actually need the IP address for is to do a reverse dns lookup which I do using the IP address and the shelling the nslookup dos command from the server. I didn't know you could set IIS to do this for you.

However, unfortunately it still doesn't solve my weird problem. Maybe I need an exorcist to remove the gremlins from my pc. Basically, I have an xml page which says one thing and an xsl page which displays something different.

Beck
 
i'd love to help further but i no longer use ms asps.

anyone else got any ideas?

if its any help at all, the first thing i thought of was web server caching. sometimes, even though you've told iis to expire the page, it doesnt update. in iis, if you right click on the web directory, select its properties, and then check or uncheck &quot;run in separate memory location&quot; it unsticks the page.

ho hum :)
 
Thanks for trying!

I can't really try your suggestion for IIS web caching because I haven't got direct access to IIS. Sadly, its ftp only.

Anyone else got any suggestions?
 
i imagine the problem lies in your parser page....who is actually calling the page to create the xml? probably iis, not the client. i believe there is a way to do identity impersonation (i know for sure there is in asp.net) in asp.

i'll see what i can find and get back mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
 
Hi Mike

It sounds like what you're saying is right - the client calls the parser page which in turn calls the asp/xml and xsl page, so essentially iis is calling the xml not the client. I am going to try parsing the ip from the parser page to the asp/xml page. Let me know if you find anything about this impersonation stuff.

Cheers,
Beck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top