how to add name spaces to xml payload using xslt?

Try this:

<?xml version="1.0"?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   >
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

  <xsl:template match="/insert">

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://www.service-now.com/u_hr_is">
      <soapenv:Body>
        <u:insert>
          <u:u_email_domain>
            <xsl:value-of select="u_email_domain"/>
          </u:u_email_domain>
          <u:u_cost_center>
            <xsl:value-of select="u_cost_center"/>
          </u:u_cost_center>
          <u:u_department>
            <xsl:value-of select="u_department"/>
          </u:u_department>
          <u:u_family_name>
            <xsl:value-of select="u_family_name"/>
          </u:u_family_name>
          <u:u_first_name>
            <xsl:value-of select="u_first_name"/>
          </u:u_first_name>
          <u:u_hris_id>
            <xsl:value-of select="u_hris_id"/>
          </u:u_hris_id>
          <u:u_job_title>
            <xsl:value-of select="u_job_title"/>
          </u:u_job_title>
          <u:u_location>
            <xsl:value-of select="u_location"/>
          </u:u_location>
          <u:u_manager_hris_id>
            <xsl:value-of select="u_manager_hris_id"/>
          </u:u_manager_hris_id>
          <u:u_vip>
            <xsl:value-of select="u_vip"/>
          </u:u_vip>
        </u:insert>
      </soapenv:Body>
    </soapenv:Envelope>
  </xsl:template>
</xsl:stylesheet>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top