We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Some CSS rules ignored when importing HTML

I am using Aspose.Cells 16.11.0 to convert HTML to XLSX. Some CSS rules are ignored by Aspose.Cells. It seems to depend on the selector used. Example:

<html>
<head>
<title>Test</title>
<style type=“text/css”>
tr th {
text-align: left;
font-weight: normal;
color: red;
}
	<span style="color:maroon;">tr</span> <span style="color:maroon;">td</span> {
		<span style="color:red;">text-align</span>: <span style="color:blue;">center</span>;
		<span style="color:red;">font-weight</span>: <span style="color:blue;">bold</span>;
		<span style="color:red;">color</span>: <span style="color:blue;">green</span>;
	}
<span style="color:blue;"></</span><span style="color:maroon;">style</span><span style="color:blue;">></span>

</head>
<body>
<table>
<tr><th>Should be red, left-aligned, not bold.</th></tr>
<tr><td>Should be green, centered, bold.</td></tr>
</table>
</body>
</html>


When I let Excel import the HTML, the CSS rules take effect - OK.
When I let Aspose convert HTML to XLSX, the CSS rules do not take effect - NOT OK.
When I remove the parent ‘tr’ from the CSS selectors, the CSS rules do take effect - OK.

Hi Ruud,


Thank you for sharing the sample.

We are able to replicate the said issue while using the latest version of Aspose.Cells for Java 16.11.10 therefore we have raised this incident for the product team’s review under the ticket CELLSJAVA-42110. Please spare us little time to properly analyze the case and revert back with updates in this regard.

Not sure if it makes any difference for your development process, but I’m working with the .NET version of Aspose.Cells; not Java.

Hi again,


Please accept my apologies for the confusion.

I have reevaluated the scenario against the latest version of Aspose.Cells for .NET 16.12.0, and I am still able to replicate the said issue therefore I have raised it as CELLSNET-45000 in our bug tracking system.

Please note, Java version is automatically ported out from the equivalent version of .NET API therefore we first fix the issue in .NET and the changes are ported out to Java API. Based on this fact, I believe, this confusion regarding the platform has not delayed the investigation into this matter.

Hi,


This is to inform you that we have fixed your issues(CELLSJAVA-42110 and CELLSNET-45000). We will soon provide you the fix after performing QA and incorporating other enhancements and fixes.

Thank you.
Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v16.12.3 and let us know your feedback.

Please note the above fix is compiled with .NET 2.0, if you need the fix compiled with .NET 4.0, then please download Aspose.Cells for .NET v16.12.3 (.NET 4.0).
Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java v16.12.3 and let us know your feedback.

I tested against 16.12.4 (obtained from another thread of mine); I hope I am correct in assuming that that version includes the fixes made in 16.12.3.

The good news is, the problem no longer occurs in the HTML sample I supplied. The bad news is, the problem persists in a multitude of other (similar) cases. This is quite disappointing; I have a feeling you patched a symptom and did not pay enough attention to the greater picture.

Please understand that when I am reporting a potential bug, I will try to supply a Minimal, Complete, Verifiable example. The goal of this example is to prove that something is broken. The goal of the example is not to explore the full scope of the problem. Trying to do so would involve writing extensive automated tests, or analyzing the source code of Aspose’s CSS implementation; preferably both. Really, that should be your job.

Anyway, I entered a separate bug report with more examples.
<a rel=“nofollow” href="https://forum.aspose.com/t/21741

Hi Ruud,


Thank you for sharing your concerns. We completely understand them, however, it is not always possible to consider all aspects of a given problem in short period of time therefore we first try to fix the main problem (as reported by the users) along with any other anomalies affecting the main scenario to deliver a quick fix. In long run, we try to gather more scenarios related to a particular feature/problem and push such cases to analysis queue for future thorough investigation.

That said, if you wish us to consider other aspects of a particular problem, we humbly request you to always create separate threads for distinct cases while providing source documents, code snippets and problem descriptions for each thread. This way, all cases will be logged in our database for analysis, and we will try to provide fix for each ticket/issue as soon as it is resolved.

Thank you for the explanation. I appreciate your dedication and I admire your speed; you’ve always managed to fix issues we reported in an amazingly short time. But no need to rush things; I’m willing to wait if you need more time to fix the problem in a broader context.

Hi Ruud,


Thank you for the nice gesture. Please note, I have simply narrated the process we follow. We may not be able to change it because it may affect many other users who need fixes for other reported problems. If we spend more time in investigating non-reported issues during the course of releases, we may end up fixing lesser number of reported defects thus effecting many users. It is best that you should follow the approach as mentioned in my previous response, that is; if you wish us to cover other aspects of a given feature/problem, please report them in separate threads for investigation and fix.

The issues you have found earlier (filed as CELLSNET-45000) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as CELLSJAVA-42110) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.