Forrest
  1. Forrest
  2. FOR-592

Pelt skin not HTML 4.01 compliant

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.7, 0.8
    • Fix Version/s: 0.8
    • Component/s: Skins (general issues)
    • Labels:
      None

      Description

      Just go to the Forrest home page and click the HTML 4.01 Compliance button. The page doesn't validate. Other sites, e.g. Apache FOP, created with the same skin have the same problem. One issue I could identify is that in the site2xhtml.xsl there are tags like:
          <input type="submit" value="Search" name="Search" i18n:attr="value"/>.
      The 'i18n:attr="value"' bit creates a non HTML 4.01 compliant attribute. Other problems are related to Javascript not being escaped correctly, e.g.
           document.write("<text>Last Published:</text> " + document.lastModified);
      should be written as
         document.write("<text>Last Published:<\/text> " + document.lastModified);

      I assume a requirement of being allowed to put the W3C HTML 4.01 Compliant logo on the site is that the pages correctly validate. Pages based on this skin don't validate but do carry the logo. Sounds like a problem to me.

        Activity

        Hide
        Gavin added a comment -
        I agree, I am a strong believer in validation and validate any sites I build to XHTML 1.1 and CSS2 where possible (not possible = client un-wavering or not caring).

        I would like to help if I can with various parts of Forrest , starting with the little things.
        How would I go about helping with this little validation matter?

        Unless Manuel is volunteering :)

        Gav...
        Show
        Gavin added a comment - I agree, I am a strong believer in validation and validate any sites I build to XHTML 1.1 and CSS2 where possible (not possible = client un-wavering or not caring). I would like to help if I can with various parts of Forrest , starting with the little things. How would I go about helping with this little validation matter? Unless Manuel is volunteering :) Gav...
        Hide
        Manuel Mall added a comment -
        I tried to fix it but are stuck. Changing:
            <input type="submit" value="Search" name="Search" i18n:attr="value"/>
        to
            <input type="submit" value="Search" name="Search"/>
        didn't seem to break anything and gets rid of one of the validation failures.

        But how does one change this?:
          <xsl:template name="last-published">
            <script type="text/javascript"><![CDATA[<!--
        document.write("]]><i18n:text >Last Published:</i18n:text><![CDATA[ " + document.lastModified);
        // -->]]></script>
          </xsl:template>
        such that the final output is:
           document.write("<text>Last Published:<\/text> " + document.lastModified);
        Show
        Manuel Mall added a comment - I tried to fix it but are stuck. Changing:     <input type="submit" value="Search" name="Search" i18n:attr="value"/> to     <input type="submit" value="Search" name="Search"/> didn't seem to break anything and gets rid of one of the validation failures. But how does one change this?:   <xsl:template name="last-published">     <script type="text/javascript"><![CDATA[<!-- document.write("]]><i18n:text >Last Published:</i18n:text><![CDATA[ " + document.lastModified); // -->]]></script>   </xsl:template> such that the final output is:    document.write("<text>Last Published:<\/text> " + document.lastModified);
        Hide
        Johannes Schaefer added a comment -
        One thing is that forrest does not even use x-html as Cocoon output serializer, so the output isn't even well-formed XML; e.g. there may be <br> tags inside without a </br> (or <br/>). Don't know what else. If you want to start on this, put the cocoon xhtml-serializer [1] in the forrest sitemaps and see if it gets better.

        Note: this is a step towards *X*HTML, to validate against HTML 4 this is not necessary.
        But then, all the XSL transformations say ...2xhtml ;-)

        [1] http://cocoon.apache.org/2.1/userdocs/serializers/xhtml-serializer.html
        Show
        Johannes Schaefer added a comment - One thing is that forrest does not even use x-html as Cocoon output serializer, so the output isn't even well-formed XML; e.g. there may be <br> tags inside without a </br> (or <br/>). Don't know what else. If you want to start on this, put the cocoon xhtml-serializer [1] in the forrest sitemaps and see if it gets better. Note: this is a step towards *X*HTML, to validate against HTML 4 this is not necessary. But then, all the XSL transformations say ...2xhtml ;-) [1] http://cocoon.apache.org/2.1/userdocs/serializers/xhtml-serializer.html
        Hide
        Ross Gardler added a comment -
        Gavin, are you on the dev mailing list? If not please join us there (see http://forrest.apache.org/mail-lists.html)

        In our current development drive for 0.8 we are planning a move to a new way of doing our output. Now is an ideal time to jump in and help as we have a proof of concept of what is to come next and are currently discussing exactly how to go about implmenting it.

        I imagine, since the current skinning system is to be deprecated, this issue will be solved as part of this new approach.

        To get you started on the background for this new system take a look at http://forrest.apache.org/docs_0_80/views.html

        I don't know if anyone has tried validating the output from this new technique yet. Perhaps that would be a good first step.

        Show
        Ross Gardler added a comment - Gavin, are you on the dev mailing list? If not please join us there (see http://forrest.apache.org/mail-lists.html) In our current development drive for 0.8 we are planning a move to a new way of doing our output. Now is an ideal time to jump in and help as we have a proof of concept of what is to come next and are currently discussing exactly how to go about implmenting it. I imagine, since the current skinning system is to be deprecated, this issue will be solved as part of this new approach. To get you started on the background for this new system take a look at http://forrest.apache.org/docs_0_80/views.html I don't know if anyone has tried validating the output from this new technique yet. Perhaps that would be a good first step.
        Hide
        David Crossley added a comment -
        Our homepage did validate recently.

        You would need to track down which stylesheets are injecting these problems. Here is an example of how i find such things ...

        cd main
        find . -type f | xargs grep "Last Published" | grep -v "\.svn"
        ... shows that it is .../pelt/xslt/html/site2xhtml.xsl

        However, i suspect that it might be something to do with the internationalisation support. There were recently some changes for that. It seems like it is not transforming the i18n:text elements properly. Maybe because for the forrest/site-author/ we don't have i18n switched on. Try doing that by setting it on in forrest.properties and doing 'forrect run' and see what the difference is.
        The project.i18n property is described in ../main/fresh-site/forrest.properties

        To find out what changes were related to "i18n" recently, search the svn@forrest mail archives for the commit messages. One way is via http://mail-archive.com/ and perhaps th edev list too.

        To find out which sitemaps deal with i18n, do ...
        cd main/webapp
        grep i18n *.*

        There is not a lot of documentation about i18n on the forrest website (search via our Google). Cheche has a document about it some )search full Google for "cheche i18n".

        Hope that all helps.
        Show
        David Crossley added a comment - Our homepage did validate recently. You would need to track down which stylesheets are injecting these problems. Here is an example of how i find such things ... cd main find . -type f | xargs grep "Last Published" | grep -v "\.svn" ... shows that it is .../pelt/xslt/html/site2xhtml.xsl However, i suspect that it might be something to do with the internationalisation support. There were recently some changes for that. It seems like it is not transforming the i18n:text elements properly. Maybe because for the forrest/site-author/ we don't have i18n switched on. Try doing that by setting it on in forrest.properties and doing 'forrect run' and see what the difference is. The project.i18n property is described in ../main/fresh-site/forrest.properties To find out what changes were related to "i18n" recently, search the svn@forrest mail archives for the commit messages. One way is via http://mail-archive.com/ and perhaps th edev list too. To find out which sitemaps deal with i18n, do ... cd main/webapp grep i18n *.* There is not a lot of documentation about i18n on the forrest website (search via our Google). Cheche has a document about it some )search full Google for "cheche i18n". Hope that all helps.
        Hide
        Gavin added a comment -
        Ok , Thanks Guys for the info,

        Now subscribed to the dev list.

        Looking through some archives I see it has been brought up before ( http://www.mail-archive.com/dev@forrest.apache.org/msg02334.html) though I dont see a solution
        proposed anywhere.

        I will get up to speed on i18n and look at some of the suggestions above.

        Thanks

        Gav...
        Show
        Gavin added a comment - Ok , Thanks Guys for the info, Now subscribed to the dev list. Looking through some archives I see it has been brought up before ( http://www.mail-archive.com/dev@forrest.apache.org/msg02334.html) though I dont see a solution proposed anywhere. I will get up to speed on i18n and look at some of the suggestions above. Thanks Gav...
        Hide
        Manuel Mall added a comment -
        I tried David's suggestion, that is enabling
            project.i18n=true
        in forrest.properties and the generated site is now HTML 4.01 compliant!!!

        This seems to indicate there is a problem in handling the <i18n:...> tags in pelt/xslt/html/site2xhtml.xsl when the feature is not enabled in the forrest.properties file.
        Show
        Manuel Mall added a comment - I tried David's suggestion, that is enabling     project.i18n=true in forrest.properties and the generated site is now HTML 4.01 compliant!!! This seems to indicate there is a problem in handling the <i18n:...> tags in pelt/xslt/html/site2xhtml.xsl when the feature is not enabled in the forrest.properties file.
        Hide
        David Crossley added a comment -
        Re: FOR-592 - pelt and i18n clarifications
        http://marc.theaimsgroup.com/?t=112316016400002
        Show
        David Crossley added a comment - Re: FOR-592 - pelt and i18n clarifications http://marc.theaimsgroup.com/?t=112316016400002
        Hide
        Gavin added a comment -
        I am still looking at this, however with looking at FOR:628, is this still worth persuing, I am happy to do so if it still ties in with the new implementation proposed.

        Gav...
        Show
        Gavin added a comment - I am still looking at this, however with looking at FOR:628, is this still worth persuing, I am happy to do so if it still ties in with the new implementation proposed. Gav...
        Hide
        Ross Gardler added a comment -
        FOR-628 will only change the way we resolve the language files for i18n it will not change the way Forrest works with those files once it has got a hold of them.

        I don't pretend to understand this issue, but I don't think FOR-628 will affect things for this issue.
        Show
        Ross Gardler added a comment - FOR-628 will only change the way we resolve the language files for i18n it will not change the way Forrest works with those files once it has got a hold of them. I don't pretend to understand this issue, but I don't think FOR-628 will affect things for this issue.
        Hide
        David Crossley added a comment -
        The discussion thread above, explored various workarounds. The easiest is to have a simple transformer to strip the i18n:text elements that remain if i18n processing is not enabled. This is now added to the trunk at r263870.
        Show
        David Crossley added a comment - The discussion thread above, explored various workarounds. The easiest is to have a simple transformer to strip the i18n:text elements that remain if i18n processing is not enabled. This is now added to the trunk at r263870.
        Hide
        David Crossley added a comment -
        Got the last remains of i18n stuff which occurs when i18n processing is not switched on. So now the output html from the pelt skin does validate.
        Show
        David Crossley added a comment - Got the last remains of i18n stuff which occurs when i18n processing is not switched on. So now the output html from the pelt skin does validate.

          People

          • Assignee:
            Unassigned
            Reporter:
            Manuel Mall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development