troubleshooting Question

How to strip - and # using xslt

Avatar of sridhar R
sridhar R asked on
3 Comments2 Solutions158 ViewsLast Modified:
Hell Experts

I Have an xml to xml conversion where i need to copy entire xml As it is but need to strip hypen from bank account numbers and # from Address.

To explain it clearly attached is the source xml. I want the target to be exactly same except that i want to avoid # in field StrtNm (address field) and - in  <Othr/Id>618-401517-001</Id></Othr> (bank account field).

Bottom line is Street address from below part of xml has #. I want that to be stripped

                  <StrtNm>3 Killiney Road, #07-01 Winsland House I</StrtNm>

And bank account no (618-401517-001) form below part of xml has '-' I want that to be stripped.

               <Nm>Winsland Investment PTE LTD</Nm>

Below is the code i am using at them moment to copy xml as it is. Can any one please update below code to accomplish above.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
    xmlns:etv="urn:com.workday/etv" exclude-result-prefixes="xs" version="2.0">
    <xsl:output method="xml"  indent="yes"/>
    <!-- identity transform -->
    <xsl:template match="@*|node()">
            <xsl:apply-templates select="@*|node() "/>
    <xsl:template match="text()">
        <xsl:value-of select="normalize-space()" />

Thanks in advance for help,
Gertone (Geert Bormans)
Information Architect
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros