Its awkward to do this with XSLT, but its not impossible. Just write a 
template that matches the <content> tag, then you should be able to use 
xslt's string manipulation functions on its value to create substituted 
output. You might need to use the <xsl:element/> tag to generate the output 
node, depending on exactly what you need to do.

I don't think you can use ANY simple substitution scheme, whatever code you 
use will need to understand xml syntax. If you are going to parse it, you 
might as well use xslt, since you're probably going to apply other 
stylesheets after this one anyway.

On Thursday 28 March 2002 15:24, Joachim Seibert wrote:
> I got the following task to solve:
>
> In certain tags of my xml files, I want to replace a keyword "foo" with
> some other data (let's say: "bar").
>
> <content>This is foo</content>
> now becomes:
> <content>This is bar</content>
>
> As background information:
> I want to add links for specified keywords out of a database:
> "foo" => <link src="http://www.foo.com";>foo</link>
>
> Has anybody done a similar thing?
> I think, Apache::Filter is the right way (or is there a better one)!?.
> I have to read all requested XML files on my own and change the content
> manually. But using simple regex's for the replacement is not enough, so
> that can corrupt my tags.
>
> Any ideas welcome!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to