Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML 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
  #1 (permalink)  
Old August 13th, 2004, 07:47 AM
Authorized User
 
Join Date: Jun 2003
Location: Gent, , Belgium.
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default HasChildnodes=true for commented xml

hi

example:
<almostweekend>
<!--saterday>beer</saterday>
<sunday>sleeping</sunday-->
</almostweekend>

I get 'true' when doing in asp:
set n = xmlobj.selectsinglenode("almostweekend")
if n.hasChildnodes then --> results in True
and
n.Childnodes.length = 1 --> must be 0 of course

what am I doing wrong? Im using msxml2.domdocument.4.0

thx
kabe
  #2 (permalink)  
Old August 13th, 2004, 09:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Your problem is that a comment is a type of node. If you want to restrict to element nodes only, use n.selectNodes("*").length - then you'll get 0 as the answer.


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Instance=True dpkbahuguna ASP.NET 3.5 Professionals 6 January 22nd, 2009 11:02 AM
Boolean True/False to Yes/No peterasimpson VB How-To 2 February 6th, 2006 07:58 PM
SmartNavigation="true" CraigJones ASP.NET 1.0 and 1.1 Basics 2 September 3rd, 2004 01:29 PM
True DBGrid 8.0 KalluMama Pro VB 6 1 August 10th, 2004 01:39 AM
Stupid but true Adam H-W SQL Server 2000 3 December 6th, 2003 12:16 PM





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