Differentiating between internal and outgoing links

Here should go questions about transforming XML with XSLT and FOP.
slaterino
Posts: 11

Differentiating between internal and outgoing links

Wed Feb 10, 2010 5:07 pm

Hi,
Does anyone know a quick way that I can differentiate between internal and outgoing links? Basically I want all outgoing links to have target=_blank and the internal ones to open in the same window. In my XML all my internal links are written as 'internal_link.php' and all outgoing as 'http://www.outgoing.com.'

I was thinking I could use xsl:attribute and have a xsl:when statement to find all links that begin with http or something like that. Is that possible? Does anyone know what criteria I could use to differentiate them?

My code will look something like this:

<a>
<xsl:attribute name="target">
<xsl:choose>
<xsl:when test="LINK BEGINS WITH HTTP">_blank</xsl:when>
<xsl:otherwise>_self</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</a>

Does anyone know what I could write for the criteria to make this work??

Many thanks,
Russ

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests