[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

XSLT subtree pruning/ filtering using namespace


Subject: XSLT subtree pruning/ filtering using namespace
From: "Chisanga Mwelwa" <sangz2000@xxxxxxxxxxx>
Date: Sat, 12 Jun 2004 10:22:49 +0000

Hi Guys!

Your help will once again be very much appreciated!

I am trying to filter out subtrees using element namespaces. I cant seem to find any decent references
to this problem so I have had a go at it my self. Below are some code snippets of what I am trying to do.
But unfortunately not getting anywhere!


Essentially I am trying to use the namespace-uri() function to solve my problem in a fashion similar
to "attribute filtering":


select="NAME[namespace-uri()='http://www.monday.com/']/AGE"

Please can anyone with an idea of how to solve my problem raise their hand? Thanks again!

MY XSLT FILE:
------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="text" indent="no"/>
<xsl:template match="EMPLOYEES">
<xsl:apply-templates select="NAME[namespace-uri()='http://www.monday.com/']/AGE"/>
</xsl:template>
...
------------------------------------------------------------------------------


MY XML FILE:
------------------------------------------------------------------------------
<EMPLOYEES>
<EMPLOYEE xmlns="http://www.monday.com/">
<NAME>Dilbert</NAME>
<AGE>99</AGE>
</EMPLOYEE>
<EMPLOYEE xmlns="http://www.tuesday.com/">
<NAME>Asok</NAME>
<AGE>9</AGE>
</EMPLOYEE>
</EMPLOYEES>
------------------------------------------------------------------------------

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo



Current Thread
Keywords