Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 3 posts ] 
Author Message
 Post subject: XML gurus
PostPosted: Tue Feb 24, 2009 16:10 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
So I'm trying to use xmlDocument.createElement(name) and node.appendChild(element) to add an element into an existing xmldocument. This works fine.

The problem is that the element name is namespace qualified, so it's "ns:name" - if I use the above methods to create and insert the element, the resulting xml has the node as <name>, not <ns:name>, which is what I want.

Any thoughts, anyone?

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: XML gurus
PostPosted: Tue Feb 24, 2009 16:53 
User avatar
Sitting balls-back folder

Joined: 30th Mar, 2008
Posts: 10173
NOTE-TAKING: H-E-R-E.

Edit: Right. Apparently, use the third form of CreateNode instead of CreateElement. The third parameter is the namespace URI, which you possibly added to your document root tag, or which presumably it might know because it's built-in or been imported, or something.

I use the XML stuff at work (in C++) but the only time I've used namespace stuff is years ago when I wrote my own XML generator, so I don't know this bit. I hope the above helps though.


Top
 Profile  
 
 Post subject: Re: XML gurus
PostPosted: Wed Feb 25, 2009 11:37 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
Looks like that's worked a treat. Cheers, Bik.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC. RIP, Dimmers.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.