Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2005, 09:24 AM
Authorized User
 
Join Date: Mar 2005
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default .net XPath expressions

Hi, I'm working with a treeview representation of a xml-document with nested elements.

If the user tries to delete a node I want to alert him that he is trying to delete

<xsl:value-of select="count(descentant-or-self::node())" />

nodes. He will also be able to cancel the request.

The problem arises when I want to count the descendants in .net:

selectedXmlNode.SelectNodes("descendant-or-self::node()").Count

because the value returned is the number of children, not descendants.

Why does this happen?

 
Old December 1st, 2005, 09:33 AM
Authorized User
 
Join Date: Mar 2005
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh my god!

The example above works prefectly fine. Solved.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Regular Expressions in ASP.NET/VB.NET toddw607 ASP.NET 1.0 and 1.1 Basics 0 February 5th, 2008 04:26 PM
Xpath expressions with attributes rbooth XSLT 3 November 11th, 2007 04:51 AM
XSL Param with XPath expressions V4mp1r3 XSLT 7 June 1st, 2007 11:47 AM
Regular Expressions in XPath sonicDace XML 0 February 12th, 2004 05:26 PM
.NET Regular Expressions Dave Doknjas .NET Web Services 2 August 8th, 2003 07:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.