|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Editing URLs
John,
Given source like: <a href="maps.maps.html">Map of maps</a> you want XSLT something like: <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>or, more simply (but not rolled into the identity transform), <xsl:template match="a">
<a href="http://{@href}">
<xsl:apply-templates select="*"/>
</a>
</xsl:template>I hope that helps-- Wendell At 05:09 PM 4/28/2003, you wrote: 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 ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








