My template is:
<xsl:template match="Link[@contentID and not(@URL)]">
<xsl:variable name="contentID" select="@contentID"/> <!-- extract contentID -->
<xsl:variable name="url"> <!-- Get URL associated with contentID -->
<!--
Wrap key( ) lookup in a for-each to cause context to be XML lookup doc
rather than current doc.
-->
<xsl:for-each select="$linkRewriteLookupDoc">
<!-- Lookup URL corresponding to contentID -->
<xsl:value-of select="key( 'linkRewriteKey', $contentID )"/>
</xsl:for-each>
</xsl:variable>
<!-- Generate a <Link> tag with URL attribute replacing the contentID attribute -->
<Link URL="{$url}">
<!-- continue processing children and any other attributes -->
<xsl:apply-templates select="@*[name()!='contentID'] | node()"/>
</Link>
</xsl:template>
Subject:Prevent Adding xmlns Attribute To Result Author:Daryl Kahl Date:26 Aug 2005 05:41 PM
Ivan,
I made your suggested change. Now I get result links of form:
<Link xmlns:xhtml="http://www.w3.org/1999/xhtml" URL="/married/a0030341.cfm">mainstream</Link>
The processing now adds the modified namespace rather than the desired form:
<Link URL="/married/a0030341.cfm">mainstream</Link>