[xsl] empty namespace declaration being generated

Subject: [xsl] empty namespace declaration being generated
From: "Scott Smith" <ssmith@xxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Jan 2007 15:46:44 -0700
I'm doing an XSL transform where I need to pull some stock ticker symbols from
one xml format and generate a different file format.  In the original source
xml file they look something like:



<ticker>nyse:ibm</ticker>



And I need to transform this into something like:



<security name="nyse:ibm"/>



The problem is that I always end up with:



<security xmlns="" name="nyse:ibm"/>



I don't want the 'xmlns=""' since it causes validation of the file to fail.



I guessed that Xalan was thinking that "nyse" was a namespace and adding the
xmlns="" to indicate that the name space for other elements in the element
were using the default namespace.  So, I rewrote the xsl transform to strip
the "nyse:", but it still does the same thing:



<security xmlns="" name="ibm" />



I also edited the source xml file and removed the "nyse:" portion (which I
can't do in production) assuming that this would verify that this was causing
the problem.  It still generated the 'xmlns=""' code so it appears my guess is
wrong.



Has anyone seen anything like this before?  Any suggestions on figuring out
what is going on?



Scott

Current Thread