Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > MS XML HTTP REQUEST AND PATHS

Reply
Thread Tools

MS XML HTTP REQUEST AND PATHS

 
 
vunet.us@gmail.com
Guest
Posts: n/a
 
      04-11-2007
Why ASP's MS XML HTTP request object gets another page's HTML source
without interpreting path differences. For example, if my page is:

www.test.asp/one/two/page1.asp

with XMLHTTP getting source code of page:

www.test.asp/one/page2.asp

and this latter page has a CSS with path ../include/css.css, it won't
be used in page1.asp because path will stay as it is "../include/
css.css", not "../../include/css.css" as needed for page1.asp?

So I only have one workaround to replace instances of ../ with ../../.
Any other suggestions or explanations?
Thank you

 
Reply With Quote
 
 
 
 
ThatsIT.net.au
Guest
Posts: n/a
 
      04-11-2007

<> wrote in message
news: oups.com...
> Why ASP's MS XML HTTP request object gets another page's HTML source
> without interpreting path differences. For example, if my page is:
>
> www.test.asp/one/two/page1.asp
>
> with XMLHTTP getting source code of page:
>
> www.test.asp/one/page2.asp
>
> and this latter page has a CSS with path ../include/css.css, it won't
> be used in page1.asp because path will stay as it is "../include/
> css.css", not "../../include/css.css" as needed for page1.asp?
>
> So I only have one workaround to replace instances of ../ with ../../.
> Any other suggestions or explanations?
> Thank you
>


I don't like to use ../ at all, as it restricts mobility.
I always use a absolute path like /include/css.css

Do this and you will not have the problem

 
Reply With Quote
 
 
 
 
Mark J. McGinty
Guest
Posts: n/a
 
      04-11-2007

<> wrote in message
news: oups.com...
> Why ASP's MS XML HTTP request object gets another page's HTML source
> without interpreting path differences. For example, if my page is:
>
> www.test.asp/one/two/page1.asp
>
> with XMLHTTP getting source code of page:
>
> www.test.asp/one/page2.asp
>
> and this latter page has a CSS with path ../include/css.css, it won't
> be used in page1.asp because path will stay as it is "../include/
> css.css", not "../../include/css.css" as needed for page1.asp?


I assume you're talking about LINK tags in an HTML doc, that reference CSS
in an external file, (as opposed to a server-side #include) correct? Those
tags are interpreted by the browser, XMLHTTP doesn't interpret anything that
can't be parsed as well-formed XML, you are using it to download raw HTML
source, that was intended to be browsed from within the context of a given
web path.

This actually applies to any tag that has an href, src, action, or any other
attribute that the browser resolves to a URL. Any relative aspects of
referenced URLs will be resolved based upon the FQ URL of the document being
browsed, by the client browser.

Content acquired using XMLHTTP will have no reference to the location from
which it was originally acquired, to do it right, you'd need to resolve all
relative URLs to be fully-qualified, based on the location from which the
content was originally served.


-Mark


> So I only have one workaround to replace instances of ../ with ../../.
> Any other suggestions or explanations?
> Thank you
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abort an HTTP request before the request timed out Gelonida N Python 0 02-27-2012 02:22 AM
urllib2.Request:: http Request sending successfully, but Responsecontains in valid data. nRk Python 1 02-12-2009 12:53 AM
Paths, gentleman, paths Ohad Lutzky Ruby 2 11-07-2006 02:15 AM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM
Convert between Windows style paths and POSIX style paths Noah Python 5 07-11-2003 09:25 PM



Advertisments