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

Free Support Forum - aspose.com

Problems with self-closing <font> tag when cell value is empty

If I use the getHtmlString() method and the cell is empty, the result is a self-closing tag (empty tag, void element, singleton tag) <font> .

Example
<Font Style="FONT-FAMILY: Calibri;FONT-SIZE: 12pt;COLOR: #000000;" />

Steps to reproduce

    String xlsxContent = "UEsDBBQABgAIAAAAIQCkU8XPTgEAAAgEAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsk8tOwzAQRfdI/EPkLYrdskAINe2CxxK6KB9g4kli1S953NL+PRP3sUChFWo3sWLP3HM9M57MNtYUa4iovavYmI9YAa72Sru2Y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AIAAAAIQAt2KmBRwEAAHMCAAARAAAAAAAAAAAAAAAAALMXAABkb2NQcm9wcy9jb3JlLnhtbFBLAQItABQABgAIAAAAIQA4hNa3mQEAACADAAAQAAAAAAAAAAAAAAAAADEaAABkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAAJAAkAPgIAAAAdAAAAAA==";
    try {
        InputStream is = new ByteArrayInputStream(Base64.getDecoder().decode(xlsxContent.getBytes(StandardCharsets.ISO_8859_1)));
        //InputStream is = new FileInputStream("test.xlsx");

        Workbook workbook = new Workbook(is);
        Worksheet ws = workbook.getWorksheets().get(0);
        Cell cell = ws.getCells().get(0, 0);

        // Result: <Font Style="FONT-FAMILY: Calibri;FONT-SIZE: 12pt;COLOR: #000000;" />
        String htmlString = cell.getHtmlString();

        assert htmlString.endsWith("/>") : "String ends not with />";
        System.out.println("String ends with />   - " + htmlString);
    } catch (Exception ex) {
        System.err.println("Error: " + ex.getMessage());
    }

There are some problems:

  1. The <font> tag is not supported in HTML5 and deprecated an previous versions
  2. The <font> tag is not a valid self-closing tag
  3. Current browsers misrepresent the content

Example

<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>test</title>
    </head>
    <body>
        <FONT style="color: #000000;" />
        <FONT style="color: #FF0000; font-size: 20px; font-weight: bold;" />
        <p>
            This content is red and bold
        </p>
    </body>
</html> 

Tested on
Aspose.Cells for Java 18.1 & 18.2

Question
Is it a bug? If yes, is it possible to fix the problems in the next version?

Thank you

@esche

Thanks for detailed explanation of the issue and considering Aspose APIs.

We were able to observe this issue. The following rendered text i.e.

This content is red and bold

should not be red and bold because <font> tag has already been closed. We have logged this issue in our database for investigation. Once, we will have some fix or other news for you, we will update you asap.

This issue has been logged as

  • CELLSJAVA-42528 - <Font> is not a valid HTML5 and self-closing tag and Web Browsers misrepresent its contents

@esche

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSJAVA-42528 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

The issues you have found earlier (filed as CELLSJAVA-42528) have been fixed in this update. This message was posted using BugNotificationTool from <a href=“https://#{request.env[“HTTPS_HOST”]}”>Downloads module by Amjad_Sahi

The issues you have found earlier (filed as CELLSJAVA-42528) have been fixed in Aspose.Cells for Java 18.4. Please also see the document for your reference:
https://docs.aspose.com/display/cellsjava/Installation

Can someone confirm that the bug is fixed?
It seems like, that the bug still exists in version 18.8. :confused:

@esche,

We have checked this behavior with the latest version v 18.9.x and observed the issue. We have marked this issue to be analyzed and tested again and will write back here once any feedback is ready to share.

@esche,

Please try to use Cell.getHtmlString(true) method, it will figure out your issue.

Let us know if you still find any issue.

Thank you for your answer.

Unfortunately, I was unable to find the description of the method parameter in the API documentation.


Under this link i found an example and the following description of the method parameter.

If you pass false as parameter, it will return you Normal Html but if you pass true as parameter, it will return Html5 string.

What means “Normal Html” and how is that defined (technical specification) ?


If I use Cell.getHtmlString(true), the method returns a “div” tag instead of a “font” tag.
Thats fine, but it’s not the reported error.

If I use Cell.getHtmlString(false) or Cell.getHtmlString(), the method still returns a self-closing “font” tag (empty tag, void element, singleton tag).

@esche,

Regarding missing description about the parameter in the API documentation, we have noted this issue and it will be updated soon.

The Normal Html is HTML 4.01 and previous versions. Main difference between HTML 4.01 and HTML 5 is that <font> tag is not supported in HTML5.

Regarding the Cell.getHtmlString( true ), if cell does not have any value the div tag is returned which is not self closed. This is properly represented by all web browsers, hence there is no issue.

Similarly if cell has some value, the div tag and cell value is properly returned which is properly rendered by all the browsers.

Could you please explain what issue is faced while using Cell.getHtmlString( true )?

For Cell.getHtmlString( false ), it returns deprecated Html tag which is expected behavior. It will return the Font tag.

Hope this clarifies all the queries.

@ahsaniqbalsidiqui

There is no issue while using Cell.getHtmlString( true )

I think this is an issue and the reason why I have opened this thread.

In HTML4 the tag must not be a self-closing tag.

Example-Result for Cell.getHtmlString( false ) --> invalid HTML4:

 <Font Style="FONT-FAMILY: Calibri;FONT-SIZE: 12pt;COLOR: #000000;" />

@esche,

The ticket has been reopened for further investigations. Once we have an update on it, we will let you know here.

@esche,

This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.