Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Very basic XML question, I am sure...

From: "Edward Wohlman" <eddwo@------.--->
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>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent