[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

PLEASE HELP: changing href attribute

Subject: PLEASE HELP: changing href attribute
From: "Meukens, Kris" <kris.meukens@xxxxxxx>
Date: Thu, 13 Jul 2000 14:06:51 +0100
changing href
Hi,

I would like to change the value (.html instead of .xml) of the href
attribute in the following well-formed HTML:

    <HTML>
        <HEAD>
            <TITLE>Test</TITLE>
        </HEAD>
        <BODY>
            <a href="http://www.test.com/test.xml"
target="_blank">test.xml</a>
        </BODY>
    </HTML>

into:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
        <HEAD>
            <TITLE>Test</TITLE>
        </HEAD>
        <BODY>
            <a href="http://www.test.com/test.hml"
target="_blank">test.xml</a>
        </BODY>
    </HTML>

I have already come up with:

	<xsl:template match="@href">
		<xsl:variable name="url">
			<xsl:value-of select="."/>
		</xsl:variable>
		<xsl:variable name="name">
			<xsl:value-of select="substring-before($url,
'.xml')"/>
		</xsl:variable>
		<xsl:variable name="htmlUrl">
			<xsl:value-of select="concat($name, '.html')"/>
		</xsl:variable> 
		href="<xsl:value-of select='$htmlUrl'/>"
	</xsl:template>

But this results in:

	<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
	<HTML>
		<HEAD>
		<TITLE>Test</TITLE>
		</HEAD>
 		<BODY>
			<a>href="http://www.test.com/test.html" test.xml</a>
		</BODY>
	</HTML>

What is wrong?

Regards,
Kris.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.