Subject: Re: [xsl] Editing URLs From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 28 Apr 2003 18:45:14 -0400 |
<xsl:template match="*|@*"> <!-- this is an identity template that will match your 'a' along with everything else --> <xsl:copy> <xsl:apply-templates select="@*|*"/> </xsl:copy> </xsl:template>
<xsl:template match="@href"> <!-- this template will match the @href attribute, and has a higher precedence than the other (so is preferred) --> <xsl:copy> <xsl:text>http://</xsl:text> <xsl:value-of select="."/> </xsl:copy> </xsl:template>
<xsl:template match="a"> <a href="http://{@href}"> <xsl:apply-templates select="*"/> </a> </xsl:template>
I hope that helps-- Wendell
I am writing an XSLT that I want to edit HREFs. Currently my XHTML source files do not include http:// in the cross-references. They are phrased as "<a href="maps.maps.html">blah, blah, blah</a>". Because of my process I need to add in "http://" at the beginning of the URLs. For the life of me, I cannot figure out how to make this work. Any suggestions?
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Editing URLs, Hemi Kara | Thread | RE: [xsl] Editing URLs, Conal Tuohy |
[xsl] Conditionally processing opti, Rick Price | Date | Re: [xsl] check parent node, Marcus Andersson |
Month |