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

RE: The identity transform and all <a> links: xslt 1.0

Subject: RE: The identity transform and all <a> links: xslt 1.0 - nearly there!!
From: "Marroc" <marrocdanderfluff@xxxxxxxxxxx>
Date: Thu, 24 Jan 2008 15:53:16 -0000
RE:  The identity transform and all <a> links: xslt 1.0
>presumably your input up until now has not been in a namespace.

Ah, thanks David - that is right! Either that or I have been modifying
previously created xsl transforms so someone else has worried about the
necessary declarations.

I now present the completed working transform for the benefit of future list
users. This transform uses the identity transform  to transfer everything
from XHTML to XHTML, replete with doctype and namespace declarations, while
converting the links to a new format. Notice particularly how the default
namespace is set in the third line of the stylesheet element:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	
xmlns:xhtml="http://www.w3.org/1999/xhtml" 
	
xmlns="http://www.w3.org/1999/xhtml" 
	
exclude-result-prefixes="xhtml">

	<xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
	
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" 
			indent="yes" encoding="UTF-8" method="xml"/>
	

	<xsl:template match="node()">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
		</xsl:copy>
	</xsl:template>

	<xsl:template match="@*">
		<xsl:copy/>
	</xsl:template>

	<xsl:template match="xhtml:a">
		<xsl:element name="a">
			<xsl:attribute
name="href">javascript:include('<xsl:value-of
select="@href"/>?i=1','BODY');</xsl:attribute>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>

Thanks again,
Richard

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.