Friday, August 17, 2012

Excluding namespaces in XSLT

When we write a complex xslt script, we need to introduce functions, templates etc.. XSLT function needs namespace definition. But we may not need those namespaces in the output.
There is an extra attribute we need to define in our xslt script to avoid those additional namespaces,which are not to be present in our output.

eg:
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:func="http://www.function.com" exclude-result-prefixes="func">
Here if you note that, i have added an attribute(ie: exclude-result-prefixes) to the style-sheet to avoid my additional namespace ,which is  http://www.function.com .

2 comments:

  1. Thanks, It work with ESB 4.6.0

    ReplyDelete
  2. My brother recommended I might like this website.
    He was totally right. This post actually made my day. You cann't imagine just
    how much time I had spent for this information!

    Thanks!

    my web blog: web site ()

    ReplyDelete