Re: [xml] empty xmlns attributes

On Tue, Feb 11, 2003 at 10:24:26PM +0000, Peter McGarvey wrote:

All I'm trying to do is take some xhtml-ish xml document, and apply a
XSLT stylesheet to turn it into xhtml 1.1.  It's working but the
W3C validation keeps moaning about `xmlns=""' attributes.  I just
can't work out why these attribute appear in the final output, or how to
get rid of them.

This is the exact same problem that was affecting my docbook site a
couple of days ago.

I'm using

same for me.

I've included the files and the output below my sig.  If someone could
cast an expert eye over them....
# ---- baz.xsl -------------------
  <xsl:template match="/">
    <html xmlns=""; xml:lang="en">
Please note ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          <xsl:text>RED :: </xsl:text>
          <xsl:value-of select="/document/@title"/>
          <xsl:value-of select="/document/@title"/>

  <xsl:template match="/document">

  <xsl:template match="a">
    <a href="{ href}">

well, after Daniel throwed an hint, I realized you just have to declare
xmlns=""; in the 1st non-xsl tag for each 
xsl:template block.  E.g. the line above should have been:

<a href="{ href}" xmlns="";>

      <img src="img/item.gif" alt="[click]"/>
      <xsl:value-of select="."/>

  <xsl:template match="*">

      <!-- xsl:copy-of select="@*" -->

      <xsl:for-each select="@*">


here I suppose you should add an <xsl:attribute> forcing again
xmlns (but I'm guessing, maybe it's a shot in the dark)

The weirdest thing is that my theory works for me, but doesn't apply 
to your example, because you get correct xmlns in your <a> tags:

# ---- OUTPUT ---------------------------
      <i>Generated by <a xmlns=""; href="";>

This lets me believe I've not understood where the real problem is :)

 Simone Piunno -- 
.-------  Adde parvum parvo magnus acervus erit  -------.
 Ferrara Linux Users Group - 
 Deep Space 6, IPv6 on Linux - 
 GNU Mailman, Mailing List Manager - 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]