This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

namespaces and copying trees



Hi!

Suppose, I have an XHTML document with some additional metadata, seperated
from the HTML by it's own namespace:


<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:foo="foonamespace">

  <foo:metadata>
     <foo:author>Joe User</foo:author>
     <foo:date>2001-08-07</foo:date>
  </foo:metadata>

  <head>
     ....
  </head>
  <body>
     ...
  </body>
</html>


Now I want (among other things) to generate an HTML version of this
file, without the metadata. How can I exclude everything in the "foo"
namespace?

For this specific case, this works (with the appropriate namespaces
declared in the stylesheet, of course):

  <xsl:template match="xhtml:html">
    <html>
      <xsl:copy-of select="xhtml:head"/>
      <xsl:copy-of select="xhtml:body"/>
    </html>
  </xsl:template>

But what if I want to allow metadata to appear at arbitrary places in
the XHTML document? I think there must be a more elegant way to say
"Take everything from this namespace, forget everything from all other
namespaces."


Thanks in advance,
   Joern

-- 
 Joern Clausen                                joern@TechFak.Uni-Bielefeld.DE
 Faculty of Technology           http://www.TechFak.Uni-Bielefeld.DE/~joern/
 Bielefeld University, Germany                           +49 (0)521/106-2905

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]