pdf export fails with the nowrap attibute

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pdf export fails with the nowrap attibute

Robin Fernandes
Hi,

Users are pasting HTML generated  by various apps into their docs and
then aren't able to render to pdf. I found that attempting to save a
document with the following content to pdf results in a 0 byte file:

<table>
<tr>
  <td nowrap></td>
</tr>
</table>

Looking at the log:
org.xml.sax.SAXParseException: Attribute name "nowrap" associated with
an element type "td" must be followed by the ' = ' character.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at com.xpn.xwiki.pdf.impl.PdfExportImpl.applyXsl(PdfExportImpl.java:164)
        at com.xpn.xwiki.pdf.impl.PdfExportImpl.convertXHtmlToXMLFO(PdfExportImpl.java:147)
        at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportXHtml(PdfExportImpl.java:79)
        at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportHtml(PdfExportImpl.java:108)
        at com.xpn.xwiki.pdf.impl.PdfExportImpl.export(PdfExportImpl.java:122)
        at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportToPDF(PdfExportImpl.java:112)
        at com.xpn.xwiki.XWikiService.renderPDF(XWikiService.java:894)
[...]

I realise that nowrap is not valid xhtml, but I would have thought
that jTidy (which I believe you are using for the html -> xhtml
conversion) would map it to nowrap="nowrap" or style="white-Space:
nowrap;". Apparently not..

Can anyone suggest a workaround?

Regards,
Robin



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws