RE: [xsl] empty namespace declaration being generated

Subject: RE: [xsl] empty namespace declaration being generated
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 23 Jan 2007 23:50:31 -0000
Oddly enough, there are some stylesheets that experienced members of this
list can debug with a fair degree of certainty without seeing a single line
of your code. There's always the possibility, though, that you have achieved
the same effect by a completely different route, so before sticking my neck
out and telling you what you've done wrong, I would prefer to see what you
have done.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Scott Smith [mailto:ssmith@xxxxxxxxxxxxxxxxxx] 
> Sent: 23 January 2007 22:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] empty namespace declaration being generated
> 
> 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