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

Using the tag xhtml:link in sitemap.xml without specifing schema location doesn't validate xsd (processContents="strict")

    Details

      Description

      The xsd that should validate the sitemap.xml generated by Liferay can be found at https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd. This xsd file specifies that, to pass validation, any tags using a namespace different than "http://www.sitemaps.org/schemas/sitemap/0.9" should specify the schema location for that namespace. It is enforce by the value "strict" below.

      ...
      <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="strict"/>
      ...
      

       If the schema location is not set withing the tag <urlset> of sitemap.xml the following error occurs at validation (use for instance the following online validation tool: https://www.corefiling.com/opensource/schemavalidate/)

      cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'xhtml:link'.
      

      To reproduce it, use the xsd file from the first url above and a sitemap obtained for a liferay site and pass it through the validation tool.

      Comment: To point to the schema location used by xmlns:xhtml="http://www.w3.org/1999/xhtml" the complete tag <urlset> should be:

      <urlset
          xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"
          xmlns:xhtml="http://www.w3.org/1999/xhtml">
      

        Attachments

          Activity

            People

            • Assignee:
              brian.chan Brian Chan
              Reporter:
              ricardo.couso Ricardo Couso
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 36 weeks, 2 days ago

                Packages

                Version Package
                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