DOC to HTML - 'lang' attribute no longer being output

I am attempting to export a Word DOC as an accessible HTML. Since it is a bilingual document it is imperative that the language codes be exported in the tags around the text.

I am using setExportLanguageInformation(true) and setExportXhtmlTransitional(true) as part of my HTML save options.

With Words version 11.3 this information is correctly output (eg. <span lang=“en-CA”… )

With Words version 13.1.0 and 13.5.0 the language information is no longer output.

I am using the exact same code and DOC file. I am simply swapping out the Aspose.Words JAR.

Continuing with the older version - 11.3 - is not an option due to other issues.

Any ideas why this behaviour has changed? Is there something I should be doing differently?

Hi Declan,

Thanks for your inquiry. Could you please attach your input Word document (.doc/.rtf files) and output HTML file showing the undesired behaviour here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

As previously stated, my HtmlSaveOptions are:

HtmlSaveOptions so = (HtmlSaveOptions) SaveOptions.createSaveOptions(SaveFormat.HTML);
so.setExportHeadersFootersMode(ExportHeadersFootersMode.NONE);
so.setExportXhtmlTransitional(true);
so.setExportLanguageInformation(true);

I am merely swapping the Aspose.Words 11.3 jar for the 13.5 version. Notice the difference in the resulting HTML output.

The 11.3 output contains the ‘lang’ attribute on span elements while the 13.5 does not.

It seems the setExportLanguageInformation() is no longer being set corerectly and performed on save.

Hi Declan,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.5.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-8385. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-8385) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.