URL normalization transformation file for WebSphere Portal

News Site news RSS

Latest articles New articles RSS

Latest news from Twitter Follow Secretkeeper4 and www.svesoftware.com on Twitter

URL normalization transformation file for WebSphere Portal

This is the example of transformation file which works as well for WCM dynamic content mapping on Portal pages, and for portlets which have render parameters. However, see other article for custom portal filter which solves a bug with missing /pw/ in optimized urls. This xsl file is tested, however, the sample files which can be found on official pages or jar files within Portal instalation don't work well.

 

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
 
<xsl:template match="text()">
</xsl:template>
 
<!-- Traverse through the tree starting at the root element -->
<xsl:template match="root">
<xsl:copy>
<xsl:copy-of select="@*"/>
<!-- Search for the state node with the attribute type = navigational -->
<xsl:apply-templates select="state[@type='navigational']"/>
</xsl:copy>
</xsl:template>
 
<xsl:template match="shared-parameters">
<xsl:copy-of select="."/>
</xsl:template>
 
<xsl:template match="state">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="selection"/>
<xsl:apply-templates select="shared-parameters"/>
<xsl:apply-templates select="portlet"/>
<xsl:apply-templates select="locale"/>
</xsl:copy>
</xsl:template>
 
<xsl:template match="portlet">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="portlet-mode"/>
<xsl:apply-templates select="parameters"/>
</xsl:copy>
</xsl:template>
 
<xsl:template match="portlet-mode">
<xsl:copy-of select="."/>
</xsl:template>
 
<xsl:template match="parameters">
<xsl:copy-of select="."/>
</xsl:template>
 
<xsl:template match="selection">
<xsl:copy-of select="."/>
</xsl:template>
 
<xsl:template match="locale">
<xsl:copy-of select="."/>
</xsl:template>
 
</xsl:stylesheet>