Skip to Content

How to remove only xml header and not namespace after mapping in HCI

Hi Experts,

I have a XML file and want to remove <?xml version="1.0" encoding="UTF-8"?>

without losing ns0 from other tags.

<?xml version="1.0" encoding="UTF-8"?>
<ns0:Save xmlns:ns0="">

when i am using XSLT mappingmentioned below,its removing all "ns0" tags as well.

So i probably need a groovy code for my HCI

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
    <xsl:template match="*">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@* | node()"/>
    <xsl:template match="@*">
        <xsl:attribute name="{local-name()}">
            <xsl:value-of select="."/>
    <xsl:template match="comment() | text() | processing-instruction()">

Please help.

Thanks and Regards,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 14, 2017 at 02:27 PM

    Hi Thouheed!

    And why not to use:

    <xsl:template match="/">
    <xsl:copy-of select="."/>

    You use local-name() function which returns only element name without namespace prefix.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded