InterPage Linking Problem in .mht file

N

naveenmoorthy

Hello All,

Thanks in advance for all your help.

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?

Regards,
Thanks in advance.
Appreciate any help in this matter
Naveen Murthy


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

From: Regression
To: Regression-User
Subject: Regression
Message-ID: Regression.html
Mime-Version: 1.0
Content-Type: multipart/related;
boundary="----------1234567890------00-----";
type="text/html"

------------1234567890------00-----
Content-Type: text/html; charset="US-ASCII"

<html>
<head>
<title>MHTLinkingProblem</title>
</head>
<frameset cols="350,*">
<frame src="cid:Left.html" name="Navigation" scrolling="yes"
noresize/>
<frame src="cid:Start.html" name="Data" scrolling="yes" noresize/>
<noframes>
<h1>Sorry, this browser does not support frames.</h1>
</noframes>
</frameset>
</html>

------------1234567890------00-----
Content-Location: cid:Left.html
Content-ID: Left.html
Content-Type: text/html

<html>
<head>
<title>Right</title>
</head>
<body>
<ul>
<li><a href="cid:Right.html"
target="Data">LinkWithoutFragmentRefURL</a></li>
<li><a href="cid:Right.html#LinkName"
target="Data">LinkWithFragmentRefURL</a></li>
</ul>
</body>
</html>

------------1234567890------00-----
Content-Location: cid:Right.html
Content-ID: Right.html
Content-Type: text/html

<html>
<head>
<title>Left</title>
</head>
<body>
This is a Right Hand Side of Page.<br/>
<br/>
<IMG SRC="cid:plus.gif" ALT="plus.gif"></body>

said:
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/
<br/><br/><br/>
said:
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/
<br/><br/><br/>

<a name="LinkName"><b>This the Location where LinkWithFragmentRefURL
should refer to.</b></a>
</body>
</html>

------------1234567890------00-----
Content-Location: cid:Start.html
Content-ID: Start.html
Content-Type: text/html

<html>
<head>
<title>Left</title>
</head>
<body>
This is a Starting Page.
</body>
</html>

------------1234567890------00-----
Content-Type: image/gif
Content-ID: plus.gif
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="plus.gif"


R0lGODlhEAAQAKIAAMDAwICAgACAgAAA/wAAAP///
wAAAAAAACH5BAUUAAUALAAAAAAQABAAAANC
WLpFxHC5MV5Uk1LLstZcIwBfyRHDWH4WmpLr1mhq7LhUDRJCMNMwx6iH
+QiEgKRDAholAcvO5hmN
oHjVSyOr7SoSADs=

------------1234567890------00-------
 
J

Jonathan N. Little

Hello All,

Thanks in advance for all your help.

I have created a .mht file in following format.

..mht | .mhtml is a creature of *Microsoft*. This is not an HTML problem,
best to try in one of the Microsoft specific developer's groups...
 
N

Neredbojias

Hello All,

Thanks in advance for all your help.

I have created a .mht file in following format.

Multiple pages and with frames to boot? Sincerely, I doubt that what
you want will ever work.
 
N

naveenmoorthy

hi Jonathan

Thanks for your reply.

It’s a problem related to “relative linking” of the html files. So I
have posted in the html related forms. I have also posted the question
in "http://social.technet.microsoft.com/Forums/" . Can you mail some
other sites which are Microsoft specific developer's groups.

Thanks for your help once again.
Happy New Year
Regards
Naveen Murthy
 
N

naveenmoorthy

hi Neredbojias

Thanks for your Suggestion.

Please copy paste the code in the above mail to some .mht file.
The .mht loads perfectly but the only the link
"LinkWithFragmentRefURL" in the left side of the frame is not working.

Reason:-
This particular link has the anchor reference to the other .html file.

Loading of the html file without the anchor reference is loading
perfectly fine.
Can you help in this particular regards. I appreciate your help for
solving the problem

Regards,
Naveen Murthy
 
N

Neredbojias

hi Neredbojias

Thanks for your Suggestion.

Please copy paste the code in the above mail to some .mht file.
The .mht loads perfectly but the only the link
"LinkWithFragmentRefURL" in the left side of the frame is not working.

Reason:-
This particular link has the anchor reference to the other .html file.

Loading of the html file without the anchor reference is loading
perfectly fine.
Can you help in this particular regards. I appreciate your help for
solving the problem

Your original question was:

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?

I'm not familiar with multi-page .mht files; didn't even know it could be
done, but I'm pretty sure you cannot address any such embedded page by
filename from anywhere. Perhaps MS has some wierd proprietary means, but
that, of course, would be beyond the scope of html.

You say "Loading of the html file without the anchor reference is loading
perfectly fine." But just _how_ is it loaded - stand alone or what?
 
J

Jani

Hello All,

Thanks in advance for all your help.

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?

Regards,
Thanks in advance.
Appreciate any help in this matter
Naveen Murthy

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



I don't know what is "cid" - that does not work with me so I kicked it
out.
[content-id... hm... you can replace it in my code if you want]
I made another .mht file with your frameset by saving the started page
in IE with "save as..." ... Test.mht.
The link works fine!
Only with Google Chrome you have to click it twice.

Present:

From: "Mit Windows Internet Explorer 8 gespeichert"
Subject: MHTLinkingProblem
Date: Thu, 1 Jan 2009 18:04:22 +0100
MIME-Version: 1.0
Content-Type: multipart/related;
type="multipart/alternative";
boundary="----=_NextPart_000_0000_01C96C3B.5FB7A170"
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C96C3B.5FB7A170
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0001_01C96C3B.5FB7C880"


------=_NextPart_001_0001_01C96C3B.5FB7C880
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: file://C:\Users\Username\Desktop\Test.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML>
<HEAD>
<TITLE>MHTLinkingProblem</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-
Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18247">
</HEAD>

<FRAMESET cols=350,*>
<FRAME noResize src="file://C:\Users\Username\Desktop\Left.html"
name=Navigation scrolling=yes>
<FRAME noResize
src="file://C:\Users\Username\Desktop\Start.html" name=Data
scrolling=yes><NOFRAMES></NOFRAMES></FRAMESET></HTML>

------=_NextPart_001_0001_01C96C3B.5FB7C880
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Content-Location: file://C:\Users\Username\Desktop\Left.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Right</TITLE>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18247"></HEAD>
<BODY>
<UL>
<LI><A target=3DData=20
=
href=3D"file:///C:/Users/Username/Desktop/
Right.html">LinkWithoutFragmentRefUR=
L</A>=20
<LI><A target=3DData=20
=
href=3D"file:///C:/Users/Username/Desktop/
Right.html#LinkName">LinkWithFragmen=
tRefURL</A>=20
</LI></UL></BODY></HTML>

------=_NextPart_001_0001_01C96C3B.5FB7C880--

------=_NextPart_000_0000_01C96C3B.5FB7A170
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: file://C:\Users\Username\Desktop\Start.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Left</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-
Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18247"></HEAD>
<BODY>This is a Starting Page. </BODY></HTML>

------=_NextPart_000_0000_01C96C3B.5FB7A170--
 
Joined
Oct 17, 2008
Messages
2
Reaction score
1
mhtml is an open standard

Check rfc 2557 and an overview of multipart mime by jacob palme. Since this thread is duplicated in many forums, I've posted some more info on stackoverflow.com before posting here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top