Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Very basic XML question, I am sure... >Thread Next - Re: Very basic XML question, I am sure... Re: Very basic XML question, I am sure...To: NULL Date: 8/2/2004 1:47:00 PM
"Craig" <brokenleg@h...> wrote in message
news:410e0c05$0$7124$db0fefd9@n......
> THanks for that people.
>
> I have now moved on a bit, and am getting the first two line added
> perfrectly. That is the XML version line, and the line with the xmlns.
>
> After that, I need to add my first data type nodes.
>
> So, I have:
>
> <?xml version="1.0"?>
> <NLIS_MESSAGE xmlns="bla blah" xmlns:xsi="blah blah">
>
> Now, under that, I need to add:
>
> <NLIS_HEADER>
> <INTERFACE_VERSION_NUMBER>6.0</INTERFACE_VERSION_NUMBER>
> </NLIS_HEADER>
>
> I set my RootNode to the NLIS_MESSAGE node, and want to add NLIS_HEADER to
> that, as above...
>
> Not sure what functiosn to use...
>
The code snippet in my last post will do the whole job for you
'you already have this part
dim outmsxml as new domdocument
outMSXML.loadXML('<?xml version = ''1.0''?>')
newNode :=
outMSXML.createNode(1,'NLIS_MESSAGE','http://www.www.www/NS/2001-01-10')
outMSXML.appendChild(newNode)
dim rootnode as ixmldomelement
rootNode := outMSXML.DocumentElement
'this part will create a new node called NLIS_HEADER
dim headernode as ixmldomelement
set headernode
=outMSXML.createnode(1,"NLIS_HEADER","http://www.www.www/NS/2001-01-10")
'this part will add that node as a child of the NLIS_MESSAGE node
rootnode.appenchild(headernode)
'this part will create a new node called INTERFACE_VERSION_NUMBER
dim ivnnode as ixmldomelement
ivnnode
=outmsxml.createnode(1,"INTERFACE_VERSION_NUMBER","http://www.www.www/NS/200
1-01-10")
'this part will add that node as a child of the NLIS_HEADER node
headernode.appendchild(ivnnode)
'this part sets the value of interface_version number to 6.0
ivnnode.text = "6.0"
that will give you your complete fragment
<NLIS_MESSAGE xmlns="http://www.www.www/NS/2001-01-10">
<NLIST_HEADER>
<INTERFACE_VERSION_NUMBER>6.0</INTERFACE_VERSION_NUMBER>
</NLIST_HEADER>
</NLIS_MESSAGE>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
