>In other words I want to replace each elament named
>jason.Smith with an
>identical element (ie not affect any of it's children
>or it's
>attributes) named Smith but only when It occurs in the
>Namespace ABC.

In other other words,
"copy the whole tree, except when there is an element named
ABC:jason.Smith
replace it with one named Smith."
(The ABC:jason.Smith and Smith names are two different names
as far as XML is concerned. ABC:jason.Smith and jason.Smith
are also two different names!)

This is an example of a Frequently Asked-for Transformation which
some of us call "identity transformation except for one thing".
You will probably find several examples in the XSLT FAQ.

You can accomplish this by starting with a classic identity
transform (as seen under xsl:copy in the XSLT specs), then add
a template with match="ABC:jason.Smith", which means that your
stylesheet needs to be aware of the ABC namespace. Inside that
template, have
<Smith>
  <xsl:apply-templates/>
</Smith>
and the copy template should pick up all the rest.
.................David Marston

Reply via email to