OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XSLT subtree pruning/ filtering using namespace

[ Lists Home | Date Index | Thread Index ]

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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS