![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XML Filter help needed XML Filter help neededTo: NULL Date: 9/3/2006 4:59:00 AM
I have an XML document which looks like
<folder>
<link author="ME"/ url="something">
<link author="YOU" url="something else"/>
<folder>
<link author="ME"/ url="something">
<folder>
<link author="ME"/ url="something">
<link author="YOU" url="something else"/>
</folder>
</folder>
</folder>
There can be any number of depths of folders and there can be any
number of authors.
What I want to do is parse the XML and return another XML document with
the applicable links and structure
My XSL looks like
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xsl:param name="Filter" select="'default value'"/>
<xsl:template match="node() | @* | / | root">
<xsl:copy>
<xsl:apply-templates select="node() | @*" />
</xsl:copy>
</xsl:template>
<xsl:template match='treenode[@Author=$Filter]' />
</xsl:stylesheet>
The desired outcome would be if I pass "YOU in as a filter I get
<folder>
<link author="YOU" url="something else"/>
<folder>
<folder>
<link author="YOU" url="something else"/>
</folder>
</folder>
</folder>
I am using the .NET System.XMl space to do the prcessing
The problem is I get an error from the treenode[@... line saying
invalid key pattern. It either has a variable reference or key
function.
Any ideas how I can fix this?
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
