SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : XML Technologies :

Previous DiscussionNext Discussion
 How to create child nodes of multiple parents of same name

I'm using the MS XML object model via Seth Juarez's XML class (http://xmlfiles.com/articles/seth/xmldatatransfer/default.asp), to create an ASX playlist but the principle will apply anywhere.

Here's the struture I want (obviously the brackets has been changed so that the code is viewable here):

{ASX version = "3.0"}
{PARAM NAME = "Encoding" VALUE = "UTF-8" /}
{ENTRY}
{ref href = "\Music\Artist\Album\Track1.mp3" /}
{/ENTRY}
{ENTRY}
{ref href = "\Music\Artist\Album\Track2.mp3" /}
{/ENTRY}
{/ASX}

I can get as far as this:

{ASX version = "3.0"}
{PARAM NAME = "Encoding" VALUE = "UTF-8" /}
{ENTRY}
{ref href = "\Music\Artist\Album\Track1.mp3" /}
{/ENTRY}
{/ASX}

using these calls:

.createChildNode "ASX", "ENTRY"
.createChildNodeWAttr "ASX//ENTRY", "REF", "href", "\Music\Artist\Album\Track1.mp3"

However, as soon as I add another call:

.createChildNode "ASX", "ENTRY"
.createChildNodeWAttr "ASX//ENTRY", "REF", "href", "\Music\Artist\Album\Track2.mp3"

then Track2.mp3 is added twice because there are now 2 parent nodes called 'ENTRY'. How can I create an ENTRY node with a child node 'REF' for every track?INVALID ARGUMENT***