Jump to content
senderj

<a ... target="_blank"> not working in xsl

Recommended Posts

I have a dynamic web page with an <a> where the href varies with the contents. I would like the <a> to open in a new tab instead of a new IE. So I use <a href="......." target="_blank"/> to achieve this but not always work: (1). using jsp to generate html, target="_blank" in the resulting html leads to new tab, as expected.(2). instead of jsp->html, using servlet to write xml to IE with xslt, target="_blank" in the xsl leads to new IE opened, not new tab.(3). In 2, if I view the source in IE and save the xml together with the xsl in same folder, open the xml directly with IE, target="_blank" leads to new tab, as expected. I don't know if there is any method to make (2) above also open new tab. Please help.

Share this post


Link to post
Share on other sites

Perhaps you need to make the servelet output the MIME type (i.e. Content-Type header value) "application/xml".I haven't worked with JSP servelets, but a quick Google search leads me to believe HttpServletResponse.setContentType() is the method you're looking for.

Share this post


Link to post
Share on other sites

Thanks for your reply. I have to apologie as I found that the problem has nothing to do with xslt, but depends on whether the page is in a frame or not. Sorry for wasting your time and appreciate your advises.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...