|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: namespaces and copying trees
Hi Joern,
> 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?
<!-- copy all in the xhtml namespace -->
<xsl:template match="xhtml:*">
<xsl:element name="{local-name()}">
<xsl:copy-of select="@*" />
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<!-- ignore all in the foo namespace -->
<!-- supposing there are no xhtml elements inside foo elements -->
<xsl:template match="foo:*" />
Cheers,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








