CssColumnSite

Articles

More

Links

Sitemap Reconstructed

The most difficult task in using RegexpURIDefaultsMatcher is finding the correct regexp.

This site wants to match URI of the form *(*).html. Thus the regexp is something like [a-z]+\([0-9]+\), making the (N) optional yields [a-z]+(\([0-9]+\))?, finally adding the fragments of interests yields ([a-z]+)(\(([0-9]+)\))?.

Setting the default fragment values is simple, just define that fragment 2 becomes by default (1), and fragment 3 becomes 1. Setting fragment 2 may be not necessary, it is just done for completeness reason.

Thus finally the sitemap is changed to


<map:match 
  pattern="^([^(/)0-9]+)(\(([0-9]+)+\))?\.html$" 
  type="regexp-defaults">
  <map:parameter name="map-default:2" value="(1)"/>
  <map:parameter name="map-default:3" value="1"/>
  ...
  <map:transform type="paginate" 
    src="pagesheets/wmlpages.xml">
    <map:parameter name="page" value="{3}"/>
  </map:transform>
  ...
      

This sitemap fragment handles both paginated, and non paginated URI requests. The optional ({N}) encoded page value is passed to the Paginator as {3} sitemap parameter value.

Summary

This article describes one use case of RegexpURIDefaultsMatcher, streamlining the sitemap in case of using Paginator transformer.

Finding the correct regexp might be the biggest obstacle for using this matcher.


[Back]  

PDF
regexpuridefaultsmatcher-tutorial

Hints

» Use Search to search all documents.
» Use Recreate Index to create the inital index. This may be neccessary once at startup.

» Search and Recreate Index are available at HTML Cocoon online deployment, only.
» Search and Recreate Index are not available on WML online, WML offline, and HTML offline deployments.