xsl-list
[Top] [All Lists]

RE: generate XHTML header without causing xmlns attributes in e.g. <table>?

2003-10-17 05:38:10
Hi Jarkko,

I thought I had to declare the name space in the xsl:template line 
like this:

<xsl:template name="exparameters" match="EX_PARAMETERS" 
xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  <table border="1" cellpadding="3" cellspacing="0" 
class="parameters" >
    <thead>
      <tr>
        ...


Well, normally these kind of declarations are done in the 
stylesheet level.


Originally I did it the way you suggests:
I have removed the xml namespace declaration in the template def. and tried 
this:

<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

However I get that xmlns="" in my table anyway?

The funny part is, I have two <table> tags in the page which is generated, and 
it is only in the second one that gets the xmlns attribute - why is that?

The template declarations look like this (now):
<xsl:template name="query" match="QUERY">
And 
<xsl:template name="exparameters" match="EX_PARAMETERS" xml:space="preserve">

First table tag in generated xhtml looks like this
<table class="querydef" cellspacing="0" cellpadding="3" border="1">

Second table tag looks like this
<table xmlns="" class="parameters" cellspacing="0" cellpadding="3" border="1">

I have tried searching the web for answers, but I don't think I've used the 
right keywords - I haven't been able to find anything which could lead me 
towards a solution to this. I am a beginner, so it might be even the simplest 
thing I've missed - so any help will be appreciated.

Have a great weekend everyone,
Flemming

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list