472,989 Members | 3,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

InterPage Linking Problem in .mht file

Hello All,


I have created a .mht file in following format.

1. The .mht file contains following htmls.
a. MHTLinkingProblem.html
b. Left.html
c. Right.html
d. Start.html
e. Plus.gif

2. The MHTLinkingProblem.html is the main html which is divided in 2 frames.
3. The Start.html dummy html to display the start of the page
4. The Right.html contains :-
a. An image with a source attribute pointing to the content-id of the image embedded in the .mht file.
Code: - <img src="cid:plus.gif" alt="plus.gif">

b. And a anchor tag with a name attribute.
Code: - <a name="LinkName">

5. The Left.html contains two links to the Right.html. :-
a. <a href="cid:Right.html" target="Data">LinkWithoutFragmentRefURL</a>
b. <a href="cid:Right.html#LinkName" target="Data">LinkWithFragmentRefURL</a>


THE PROBLEM:-

The link shown in 5.b is not working. That is I am not able to refer a particular fragment of the html file using .mht. This is because the .mht resolve this URL in following format:-

cid:Right.html#LinkName

Now there is no content-id naming cid:Right.html#LinkName so it returns a error Page Cannot be displayed.


QUESTION:-

1. How to use the Relative Reference URL in the href attribute of the anchor tag so that it refers to a fragment(anchor tag with name attribute) of ANOTHER html in the same .mht file?

Copy the code and save it as <Test>.mht file.
CODE :-

Expand|Select|Wrap|Line Numbers
  1. From: Regression
  2. To: Regression-User
  3. Subject: Regression
  4. Message-ID: Regression.html
  5. Mime-Version: 1.0
  6. Content-Type: multipart/related; boundary="----------1234567890------00-----";
  7. type="text/html"
  8.  
  9. ------------1234567890------00-----
  10. Content-Type: text/html; charset="US-ASCII"    
  11.  
  12. <html>
  13.     <head>    
  14.         <title>MHTLinkingProblem</title>
  15.     </head>
  16.     <frameset cols="350,*">
  17.         <frame src="cid:Left.html" name="Navigation" scrolling="yes" noresize/>
  18.         <frame src="cid:Start.html" name="Data" scrolling="yes" noresize/>
  19.     <noframes>
  20.         <h1>Sorry, this browser does not support frames.</h1>
  21.     </noframes>
  22.     </frameset>
  23. </html>
  24.  
  25. ------------1234567890------00-----
  26. Content-Location: cid:Left.html
  27. Content-ID: Left.html
  28. Content-Type: text/html            
  29.  
  30. <html>
  31.     <head>
  32.         <title>Right</title>
  33.     </head>
  34.     <body>    
  35.         <ul>
  36.             <li><a href="cid:Right.html" target="Data">LinkWithoutFragmentRefURL</a></li>
  37.             <li><a href="cid:Right.html#LinkName" target="Data">LinkWithFragmentRefURL</a></li>
  38.         </ul>
  39.     </body>
  40. </html>
  41.  
  42. ------------1234567890------00-----
  43. Content-Location: cid:Right.html
  44. Content-ID: Right.html
  45. Content-Type: text/html            
  46.  
  47. <html>
  48.     <head>
  49.         <title>Left</title>
  50.     </head>
  51.     <body>
  52.         This is a Right Hand Side of Page.<br/>        
  53.         <br/>                
  54.         <IMG SRC="cid:plus.gif" ALT="plus.gif"></body>
  55.  
  56.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  57.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  58.  
  59.         <a name="LinkName"><b>This the Location where LinkWithFragmentRefURL should refer to.</b></a>                    
  60. </body>
  61. </html>
  62.  
  63. ------------1234567890------00-----
  64. Content-Location: cid:Start.html
  65. Content-ID: Start.html
  66. Content-Type: text/html            
  67.  
  68. <html>
  69.     <head>
  70.         <title>Left</title>
  71.     </head>
  72.     <body>
  73.         This is a Starting Page.
  74.     </body>
  75. </html>
  76.  
  77. ------------1234567890------00-----
  78. Content-Type: image/gif
  79. Content-ID: plus.gif
  80. Content-Transfer-Encoding: base64
  81. Content-Disposition: inline; filename="plus.gif"
  82.  
  83.  
  84. R0lGODlhEAAQAKIAAMDAwICAgACAgAAA/wAAAP///wAAAAAAACH5BAUUAAUALAAAAAAQABAAAANC
  85. WLpFxHC5MV5Uk1LLstZcIwBfyRHDWH4WmpLr1mhq7LhUDRJCMNMwx6iH+QiEgKRDAholAcvO5hmN
  86. oHjVSyOr7SoSADs=
  87.  
  88. ------------1234567890------00-------
Dec 24 '08 #1
4 7994
numberwhun
3,509 Expert Mod 2GB
I am not trying to feign ignorance, but what is a ".mht" file? Is this something specific to a program? If so, is this a problem with that program or with HTML itself?

I ask as this is an HTML forum, not a forum for a specific program and I would have to move this thread to the miscellaneous forum.

Regards,

Jeff
Dec 27 '08 #2
eWish
971 Expert 512MB
@Jeff - .mht is a Microsoft thing.

--Kevin
Dec 28 '08 #3
drhowarddrfine
7,435 Expert 4TB
Yes, it's an archiving file. Firefox has an extension, and 'nix has programs, that can read/write these so I find it useful to save pages that contain graphics and running javascript.
Dec 28 '08 #4
Hello all,

Thanks everyone for the reply.

I am checking the replies today.

.mht helps bundle multiple files such as hmtl/CSS/Images/JavaScript to one single file, exactly as the "Kevin" above has posted.

The problem is at its core is an html relative linking within pages.

1.For example, I have a page Left.html has a relative hyper linking within the some other page Right.html#LinkName.All these linking are working as an individual html files but when I combine all the html files to single .mht file the links with

Expand|Select|Wrap|Line Numbers
  1. <a href="cid:Right.html#LinkName" target="Data">LinkWithFragmentRefURL</a> 
Show the error on the page. But the link

Expand|Select|Wrap|Line Numbers
  1. <a href="cid:Right.html" target="Data">LinkWithoutFragmentRefURL</a> 
Works fine.


2.From the .mht point of view, if I Try navigating to the 2nd link from another page (Right.html), I get an error. But navigating to the 2nd link from the same page (Left.html) is no problem i.e. checking on the link form the same page.

Regards
Naveen Murthy

Copy pase the code and save it as <Test.mht>

Code:-

Expand|Select|Wrap|Line Numbers
  1. From: Regression
  2. To: Regression-User
  3. Subject: Regression
  4. Message-ID: Regression.html
  5. Mime-Version: 1.0
  6. AbsoluteURI: "thismessage:/"
  7. Content-Type: multipart/related; boundary="----------1234567890------00-----";
  8. type="text/html"
  9.  
  10. ------------1234567890------00-----
  11. Content-Type: text/html; charset="US-ASCII"    
  12.  
  13. <html>
  14.     <head>    
  15.         <title>MHTLinkingProblem</title>
  16.     </head>
  17.     <frameset cols="350,*">
  18.         <frame src="file://c:/Left.html" name="Navigation" scrolling="yes" noresize/>
  19.         <frame src="cid:Start.html" name="Data" scrolling="yes" noresize/>
  20.     <noframes>
  21.         <h1>Sorry, this browser does not support frames.</h1>
  22.     </noframes>
  23.     </frameset>
  24. </html>
  25.  
  26. ------------1234567890------00-----
  27. Content-Location: file://c:/Left.html
  28. <!-- Content-ID: Left.html -->
  29. Content-Type:text/html;
  30.  
  31.  
  32. <html>
  33.     <head>
  34.         <title>Right</title>
  35.     </head>
  36.     <body>    
  37.         <ul>
  38.             <li><a href="cid:Right" target="Data">LinkWithoutFragmentRefURL</a></li>            
  39.             <li><a href="cid:Right#LinkName" target="Data">LinkWithFragmentRefURL</a></li> <!-- mhtml:file://C:\Documents%20and%20Settings\nam1cob\Desktop\MHTLinkingProblem.mht! -->
  40.  
  41.         </ul>
  42.     </body>
  43. </html>
  44.  
  45. ------------1234567890------00-----
  46. Content-Location: file://c:/Right.html
  47. Content-ID: Right
  48. Content-Type:  text/html            
  49.  
  50. <html>
  51.     <head>
  52.         <title>Left</title>
  53.     </head>
  54.     <body>
  55.         This is a Right Hand Side of Page.<br/>        
  56.         <br/>                
  57.         <IMG SRC="cid:plus.gif" ALT="plus.gif"></body>
  58.         <!-- Please dont delete these br. These are required. -->
  59.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  60.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  61.  
  62.  
  63.  
  64.         <a name="LinkName"><b>This the Location where LinkWithFragmentRefURL should refer to.</b></a>                        
  65.  
  66.     </body>
  67. </html>
  68.  
  69. ------------1234567890------00-----
  70. Content-Location: cid:Start.html
  71. Content-ID: Start.html
  72. Content-Type: text/html            
  73.  
  74. <html>
  75.     <head>
  76.         <title>Left</title>
  77.     </head>
  78.     <body>
  79.         This is a Starting Page.
  80.     </body>
  81. </html>
  82.  
  83. ------------1234567890------00-----
  84. Content-Type: image/gif
  85. Content-ID: plus.gif
  86. Content-Transfer-Encoding: base64
  87. Content-Disposition: inline; filename="plus.gif"
  88.  
  89.  
  90. R0lGODlhEAAQAKIAAMDAwICAgACAgAAA/wAAAP///wAAAAAAACH5BAUUAAUALAAAAAAQABAAAANC
  91. WLpFxHC5MV5Uk1LLstZcIwBfyRHDWH4WmpLr1mhq7LhUDRJCMNMwx6iH+QiEgKRDAholAcvO5hmN
  92. oHjVSyOr7SoSADs=
  93.  
  94. ------------1234567890------00-------
Dec 29 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dibyendu Roy | last post by:
Hi All, I build an object called "dblorcle" to connect to oracle database in Sun solaris box. This is built linking with various oracle ".a" (archived, for static linking) files come with standard...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
1
by: Venky | last post by:
I'm compiling a C program that is using Interbase 6.0 APIS. Getting the following errors at the time of linking. Linking test.exe: Linker Warning: No module definition file specified: using...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
6
by: Rudy Ray Moore | last post by:
I work with a multi-project workspace. One project (the "startup" project) has a "Configuration Type" of "Application (.exe)". The other 40 projects have a "Configuration Type" of "Static Library...
0
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
2
by: Jim Johnson | last post by:
C++ linking works by using Linker to combine object files into single exe file. Does each .cpp file compile to a single .obj file? If the .cpp code called functions in some library (.lib) does...
1
by: agarwasa2008 | last post by:
Hi, I have a perfect file called "Products.xls" that I link to my MS Access 2003 database and everytthing looks good in that file. When I view the same file after linking in my database the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.