XSLT – Change namespace attribute

I need to change whiteSpaceMode namespace attribute from xslt,

Example,

<?xml version="1.0" encoding="UTF-8"?>
<content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:abc="http://www.anyurl.com/ContentXML" schemaVersion="2.1"
    xsi:schemaLocation="http://www.anyurl.com/ContentXML 
    whiteSpaceMode="strict">

<doc>
......more codes....
</doc>

Above code I need to change whiteSpaceMode="strict" to whiteSpaceMode=”preserve” using xslt.

so output xml file should be,

<?xml version="1.0" encoding="UTF-8"?>
<content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:abc="http://www.anyurl.com/ContentXML" schemaVersion="2.1"
    xsi:schemaLocation="http://www.anyurl.com/ContentXML 
    whiteSpaceMode="preserve">

<doc>
......more codes....
</doc>

any suggestion how can I do this?


Source: xml

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.