Question Creating an xml file with XDocument

J_Dev_27

New member
Joined
Oct 3, 2012
Messages
1
Programming Experience
Beginner
Hi Programmers,

I am creating an xml file in vb.net.

I am basically done with it , but i have been stuck on a problem that it driving me insane.

Within my creation for my Namespace in my root node , i need it to look like this in the xml file :

<PositionOpening xmlns="http://ns.hr-xml.org/2006-02-28" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

I can get the xmlns:xsi part to work , but i cannot at all get the xmlns="http://ns.hr-xml.org/2006-02-28" to work.

I have been stuck on this for weeks ! :numbness:

Tried so many different things to get it to look like that.

I dont want to add a prefix to xmlns because that is not how i want it.

I know that if you get the namespace to be ns : "http://ns.hr-xml.org/2006-02-28"

then xmlns="" will appear on some of my element tags.

And then add ns to every element it will make the extra xmlns="" dissapear , but i dont want it like that because it is corrupting the xml file.

I need someone to please help me in getting this to work.

I cant keep on wasting time on this annoying issue.

I thank all of you in advance.
 
Back
Top