Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

XSL Replace with multiple values without duplications

I’m trying to filter and then replace umlauts in a file name. Unfortunately this doesn’t really work, because if all three umlauts are included, the variable name is also written several times in the filename.

<xsl:choose>
<xsl:when test="contains($name,'ä') or contains($name,'ö') or contains($name,'ü')">
<xsl:value-of select="replace($name, 'ä', 'ae'),replace($name,'ö','oe'),replace($name, 'ü', 'ue') " />
</xsl:when>

No matter what I try, either it just replaces an umlaut, or I have multiple times the filename after the transformation.
When I try to create a nested replace where the variable occurs only once, the file cannot be saved without errors….
Does anyone of you have an idea how I have only once the name in the filename, but all umlaut are replaced?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try:

<xsl:value-of select="replace(replace(replace($name, 'ä', 'ae'),'ö','oe'), 'ü', 'ue')"/>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading