[xsl] Dumb Question - XML to XML changing only a few values

Subject: [xsl] Dumb Question - XML to XML changing only a few values
From: Mark Anderson <mark.anderson@xxxxxxxxxxxxxxx>
Date: Fri, 30 Nov 2007 22:13:11 +0000
Hi All

I've used XSL a lot, but always to transform XML to HTML, so I've known about
and processed every XML element I output in the XML.

I'm sure what I want to do is really easy, but I've no idea how to do it

I now need to transform XML to XML, but change the contents of only one or two
elements. The source XML is very large and, with the exception of the elements
I need to replace, I won't know the remainder of the contents.

Is there a way to say "just copy everything to the destination XML, but any
instance of <a></a> will have its contents replaced"?

For example

Source XML

<a>A</a>
<b>B</b>
<c>C</c>
<d>D</d>
<e>E</e>
<f>F</f>
<g>G</g>

So I just want to say replace contents of <a></a> with 12345 and just copy
everything else

Destination XML

<a>12345</a>
<b>B</b>
<c>C</c>
<d>D</d>
<e>E</e>
<f>F</f>
<g>G</g>

Thanks in advance

Mark

Current Thread