[xslt] Confused on how to get rid of XMLNS in my HTML

I have a script I call "atom2theme.xsl" using the XML::LibXSLT and XML::LibXML perl modules (although 
this feature shows up in xsltproc too).  I use it to transform my blogger atom.xml feed into a themed 
HTML page.

The atom.xml file goes:

<feed version="0.3" xml:lang="en-US" xmlns="http://purl.org/atom/ns#";> 
   <entry xmlns="http://purl.org/atom/ns#";> 
      <content type="application/xhtml+xml" xml:base="http://MyBloggerName.blogspot.com"; xml:
         <div xmlns="http://www.w3.org/1999/xhtml";>

w/ stuff in between.  I then match w/ templates like this:

   <xsl:template match="atom:feed">
      <xsl:template match="atom:entry">
         <xsl:template match="atom:content">
            <div xmlns="http://www.w3.org/1999/xhtml";>

Inside the content template, I would *really* like to just short cut the process and do a copy-of 
"xhtml:div" to display my blog post markup.  BUT, when I do that my HTML div tag has the XMLNS 
attribute.  E.g.:
   <div xmlns="http://www.w3.org/1999/xhtml";>Text<dl> <dd>Term</dd> <dt>Definition</dt> </dl> </div> 

I know that copy-of copies from the XML document (which is where the namespace exists) into the result 
tree, whereas the value-of copies plain text.  But I need the copy ... just not the namespaces.

I have tried adding "xhtml" and "http://www.w3.org/1999/xhtml"; to extension-element-prefixes, exclude-
result-prefixes, and namespace all over the place.  I have searched google and w3.org, but I still dont 
understand the intricacies of namespaces yet (I know what they are /for/, just not how to get /rid/ of 
them).  I cant find a way to erase the XMLNS from that div tag.

I dont really mind the XMLNS being there, but it does not validate HTML 4.01 on the w3 validators ... 
which annoys me.  I have a stripped down test XSL and XML file if necessary, but I didnt want to spam 
the list w/ irrelevant data if possible.

So, is there a quick and simple answer I am overlooking?  Plz reply to me and list since I am in digest 
mode.   Thx!


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