473,395 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MS XML HTTP REQUEST AND PATHS

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

Apr 11 '07 #1
2 2023

<vu******@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr 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

Apr 11 '07 #2

<vu******@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr 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

Apr 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Noah | last post by:
Does anyone have a function to convert back and forth between NT style paths and POSIX style? It seems trivial, but I want to make sure I don't overlook some obscure detail. Is it a simple matter...
3
by: Laura | last post by:
At two different points in my website I have used a file include to display a list of hyperlinks on a page rather than saving the list of links in two different places. To determine the paths...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
2
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include...
0
by: Chris Gill | last post by:
I'm trying to use cookieless sessions in asp.net using the InProc mode (for various reasons it is not desirable for us to use the other modes if it is possible to avoid them). My problem revolves...
3
by: JeffDotNet | last post by:
I wrote a small data processing application that writes a summary of several hundred files. I use drag and drop on a panel (Panel1) to grab the absolute path to each of these files. Then I begin...
5
by: costantinos | last post by:
Hello. I have implemented the Dijkstra shortest path algorithm, it works fine but I have one question on how I can improve something. I want to find all the possible shortest paths from a node...
6
by: Håkan | last post by:
Hi! I get HTTP/1.1 400 Bad Request when I try to access a aspx-page running on server 2003 SP1 from internet explorer 6 running on the same machine. Here is the URL I am using: ...
0
by: Steve Holden | last post by:
dudeja.rajat@gmail.com wrote: You could use one of the URL libraries. The os.path module is for dealing with the local filesystem. The absence of any exception from f =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.