MaikJaek / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

href attribute not being detected when getting the linkUri #120

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Generate an xhtml document that includes an anchor tag with an href 
attribute. <a href="http://www.google.ca>Google</a>

2. Run the document through jTidy's parseDOM() method to generate a 
w3c.Document.

3. Provide the document to an xhtmlrenderer instance to generate a PDF using 
the ITextRenderer. 

What is the expected output? What do you see instead?
The expected output is a PDF with an embedded link that goes out to Google 
however the link is not functional, the text appears, and is highlighted blue 
but is not a link.

What version of the product are you using? On what operating system?
Version is release 8 on multiple operating systems Linux, Mac OS X, Windows.

Please provide any additional information below.
Below is a link to a reported issue with the same problem.  In my investigation 
I found that on line:178 of XhtmlCssOnlyNamespaceHandler.java in the 
getLinkUri() method the, call to e.hasAttribute("href") was always returning 
false even though the anchor tag did have an href attribute.  This may have had 
something to do with the DOM node created by the JTidy parser, perhaps the 
interface implementation did not properly support this method. I found that 
changing e.hasAttribute("href") to e.getAttribute("href") != null corrected the 
problem.  The may be a more suitable approach as well since the code within the 
if block is href = e.getAttribute("href");.     

http://java.net/projects/xhtmlrenderer/lists/users/archive/2008-10/message/42

Original issue reported on code.google.com by brent.va...@gmail.com on 22 Feb 2011 at 2:17

GoogleCodeExporter commented 8 years ago
Excuse the missing closing quote(") on the url in the reproduction steps, that 
was a typo.

Original comment by brent.va...@gmail.com on 22 Feb 2011 at 2:18