Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the 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
 
Old April 17th, 2008, 03:41 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Any method with the name 'Append' in it will always likely put new stuff at the end, hence its name. You want ot be looking at the 'Insert' methods instead.

XmlNode.InsertBefore for example takes another node as the place to insert before, so something like this would work:

Code:
if( xmlParent.ChildNodes.Count == 0 )
  xmlParent.Append(newNode);
else
  xmlParent.InsertBefore(newNode, xmlParent.ChildNodes[0]);
/- Sam Judson : Wrox Technical Editor -/
 
Old April 17th, 2008, 04:19 PM
Registered User
 
Join Date: Apr 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the info joe/sam. With some modifications I was able to get it working.

Thanks for the help!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple input xml / get data from other xml file elayaraja.s XSLT 3 July 25th, 2008 06:59 AM
creating new xml file from existing deepee XML 1 July 25th, 2006 10:35 AM
inserting XML/ASCII data into SQL using VB.net outcast1881 Other Programming Languages 0 July 20th, 2006 07:39 AM
Getting VB.NET to load & update XML file kyma XML 0 March 19th, 2005 04:58 PM
XML to XML through an XSLT (VB.NET) dimondwoof XSLT 1 June 25th, 2003 12:07 PM





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