Jump to content
  • 1.2.7 : Incorrect/not valid generated HTML

    Assigned User teodord
    CategoryBug report



    I just noticed some errors/not valid code in generated html.

    Let's say we chose HTML 4.01 Transitionnal recommendation.


    Not Valid :




    --> better :

    1)in the css...

    body { color:#xxxxxx; }

    a:link { color:#xxxxxx; }

    a:active { color:#xxxxxx; }

    a:visited { color:#xxxxxx; }

    2)Write instead


    Error :

    Each time you have the attribute "rowspan" you got rowspan="x"" instead of rowspan="x"


    If we choose more recent recommendation (let's say XHTML (I guess you know them I saw "/>" in your unary tags) I saw two others things:


    instead of


    instead of


    About standards why not add a doctype too ?



    With IE7 released and FireFox 2.0 soon, it could be a good thing to correct this :-)

    User Feedback

    Recommended Comments




    Our current HTXML export produces XHTML 1.0 compatible output.

    We followed specifications available here:



    So your first two assumptions about HTML 4.01 recommendation, I don\'t know it they are something we should comply with, as we never said we are going to comply with HTML 4.01.

    However, I went through those specifications and did not find anything about the obligation to split the tag into a starting and closing tags like you said:

    If there is such a recommendation, please mention the specific paragraph in the specs that says so and we\'ll see about it again.


    I was not able to reproduce the rowspan quotes problem you mentioned. Please provide a JRXML template that would show this problem. The generated HTML would also be interesting to see.


    In the XHTML specifications we read there was no mention about using the style tag to specify the width of a

    element. Same for background. If there are such recommendations, please send the specific paragraph that says so.


    Also, unary tags seem to be OK with XHTML as long as they are closed. Regardless if they are closed as empty tags (such as

    ). If this is not the case, please provide exact specifications you followed as well.


    If you look at the source code of our JRHtmlExporter, you\'ll see that the doctype was commented out. This is because of a problem with IE, which seemed to make alignment properties spill over into the content of tables in some sort of inheritance that is never mentioned anywhere in the XHTML specifications. To workaround this IE bug and because we just could not wait for the IE 7 to be released (who knows how many other new problems it will bring along), we just commented out the doctype. Users that want to have a doctype in their generated HTML, could simply use the HTML_HEADER parameter of our exporter and specify any HTML content that they want to see inserted at the beginning of the resulting file. This should also be a solution for getting rid of the deprecated attributes in the

    tag, for those who want it.


    I hope this helps.



    Link to comment
    Share on other sites

    That\'s right, in XHTML, is valid. I chose HTML 4.01 at the beginning because it was a minimum.


    I wanted to be sure so I tried to validate the code with the W3C online tool (for a XHTML 1.0 compliance) : width and bgcolor attributes are clearly deprecated.


    For rowspan="x"" instead of rowspan="x" problem. I finally found out that it comes from rectangles only.


    Create a report with at least 2 rectangles (error doesn\'t appear with only one rectangle) and check the generated html code.


    Keep me informed if you get the same error. If not, i\'ll attach the jrxml file.

    Link to comment
    Share on other sites




    The rowspan was indeed a bug. It is now fixed on the SVN repository and will be part of the next release.


    As for the other XHTML compliance issues, I just added the DOCTYPE declaration by uncommenting the two lines in the JRHtmlExporter (I already explained why they are commented) and then tested the generated XHTML file using the W3C tool. The file was perfectly valid even if it contained "width", "bgcolor" and the whole set of attributes in the


    So I think these are non issues and the error messages the validator gave were related only to the missing DOCTYPE, which confused the XML parser.


    So I\'m considering this closed.


    Thank you,



    Link to comment
    Share on other sites

    Oh I\'m sorry I guess it\'s because I validated for XHTML 1.0 Strict not for Transitionnal.


    For example here :



    and the results :




    As you can see, validation is harder with a XHTML 1.0 Strict doctype ("width", "bgcolor" and the whole set of attributes in the

    create errors).


    Anyway, thank you for correcting the rowspan bug ^^.



    Link to comment
    Share on other sites

  • Create New...