Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-76115

The sitemap.xml is generated with optional tags lastmod and changefreq in the wrong order

    Details

      Description

      The sitemaps generated by Liferay use the namespace "http://www.sitemaps.org/schemas/sitemap/0.9". The associated xsd file can be obtained at https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd

      This xsd imposes an sequence order for the tags

      1. loc
      2. lastmod,
      3. changefreq,
      4. priority

      Third-party services that validate the sitemap.xml against this xsd will issue an error if any of those tags are in the wrong order.

      To see this error use the attached script in the Groovy console, using a valid url for the generated sitemap.xml (by going to localhost:8080/sitemap.xml and choosing the sitemap of a site).

      Observed:

      cvc-complex-type.2.4.a: Invalid content was found starting with element 'lastmod'. One of '{"http://www.sitemaps.org/schemas/sitemap/0.9":priority, WC[##other:"http://www.sitemaps.org/schemas/sitemap/0.9"]}' is expected.
      
      

      Expected: The generated xml is valid against the xsd.

        Attachments

        1. fixed.png
          fixed.png
          177 kB
        2. Q.PNG
          Q.PNG
          43 kB
        3. reproduce.png
          reproduce.png
          162 kB
        4. validate-sitemap-xsd_62x.groovy
          1 kB
        5. validate-sitemap-xsd.groovy
          1 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 37 weeks, 6 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP33
                  7.0.0 DXP SP7
                  7.0.5 CE GA6
                  7.0.X
                  7.1.0 M1
                  7.1.X
                  Master