[xsl] Quick way to change element names

Subject: [xsl] Quick way to change element names
From: "Woods, Christopher" <cwoods@xxxxxxxxxxxxxxxxx>
Date: Thu, 19 Jan 2006 16:25:01 -0500
I have a batch of documents that began life as plain old HTML and
converted them to XML using James Clark's SX utility.  Now I need to
change all the tags in each file from the current format that looks like
this:

<p>blah blah blah</p>  to something that looks like this:

<xhtml:p>blah blah blah</xhtml:p>

My first attempt was to try this:

<xsl:for-each select="*"><xsl:element
name="{concat('xhtml:',name())}"><xsl:apply-templates/></xsl:element>

The above is simplified as there are attributes and the like in the mix
but it worked fairly except in circumstances where things are nested
more than two layers deep.  I'm looking for a quick way to change the
tags from <myTag/> to <xhtml:myTag/> using XSL.  I suppose this could be
accomplished through some sort of find/replace macro but I'd prefer to
run a transform on the whole batch and have done with it.  Any
suggestions?

TIA,

Chris

Current Thread