This discussion is archived
1 Reply Latest reply: Aug 29, 2012 9:09 PM by 631145 RSS

Create xmlns attribute in the XML using XSLT Transformation

631145 Newbie
Currently Being Moderated
I am trying to add the xmlns attribute to the resulting XML with a value passed by parameter during XSLT transformation using JDK Transformer but it always defaults to

My source XML



<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="" xmlns="">
<xsl:param name="myNameSpace" select="''"/>
<xsl:template match="/">
<xsl:attribute name="xmlns:neil">
<xsl:value-of select="$myNameSpace"/>

My Result

<?xml version="1.0"?>
<process xmlns="" xmlns:neil="">

My Desired Result

<?xml version="1.0"?>
<process xmlns="" xmlns:neil="">

Cross-posted at [stackoverflow |]


  • Correct Answers - 10 points
  • Helpful Answers - 5 points