all groups > dotnet xml > may 2004 >
You're in the

dotnet xml

group:

XPath


XPath Mike
5/29/2004 3:45:05 PM
dotnet xml:

Hi,

I am new to XPath and I am stuck with an expression. I would like to =
select all servers which the user subscribed to. Here is my XML:
<forums>
<forum>
<name>AAA</name>
<subscribed>1</subscribed>
</forum>
<forum>
<name>BBB</name>
<subscribed>0</subscribed>
</forum>
.....
.....
I would like to retrieve "AAA" since it is a server with =
"subscribed=3D1".

I tried various syntaxes, unsuccessfully. This is the last one:

....... ("servers:server[servers:name=3D'" + server + =
"']/servers:forums/servers:name[subscribed=3D'1']", m_ServersDoc);

Thanks
RE: XPath Hal
6/1/2004 8:21:04 PM
Mike

Try this (XSL doc)
-------------------

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><html><body><h1>Test</h1><xsl:apply-templates select="forums"/></body></html></xsl:template><xsl:template match="forums"><xsl:for-each select="forum"><xsl:if test="subscribed/text()='1'"><p>Name:
AddThis Social Bookmark Button