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 10:40:00 AM 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...
"Edward Wohlman" <eddwo@h...> wrote in message
news:u7WS2KHeEHA.1652@T......
>
> "Craig" <brokenleg@h...> wrote in message
> news:410e01c8$0$7133$db0fefd9@n......
> > I am new to XML, and am trying to create a brand new document. I don't
> want
> > to use myXML.load('....');
> >
> > I need to create the nodes with functions of MSXML.
> >
> > This is what I have. (Delphi code, but understandable)
> >
> > outMSXML.loadXML('<?xml version = ''1.0''?>');
> > rootNode := outMSXML.DocumentElement;
> >
> > newNode := outMSXML.createNode(1, 'NLIS_MESSAGE',
> > 'http://www.www.www/NS/2001-01-10');
> > rootNode.appendChild( newNode );
> >
> > However, this is wrong. For a start, rootNode is nil, as there isn't a
> node
> > yet. How do I start it off? How do I create the first line? Below, os
what
> I
> > am trying to obtain.
> >
> >
> > <NLIS_MESSAGE xmlns="http://www.www.www/NS/2001-01-10"
> > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > xsi:schemaLocation="http://www.www.www/NS/2001-01-10 LA_Requests.xsd">
> > <NLIS_HEADER>
> > <INTERFACE_VERSION_NUMBER>6.00</INTERFACE_VERSION_NUMBER>
>
> You don't have to append to .documentelement, you can append to outMSXML
> directly. The first element node you append to the root of the dom becomes
> to document element.
>
> outMSXML.loadXML('<?xml version = ''1.0''?>');
> newNode := outMSXML.createNode(1,
> 'NLIS_MESSAGE','http://www.www.www/NS/2001-01-10');
> outMSXML.appendChild(newNode);
> rootNode := outMSXML.DocumentElement;
> headernode =
> outMSXML.createnode(1,"NLIS_HEADER","http://www.www.www/NS/2001-01-10")
> rootnode.appenchild(headernode)
> ivnnode =
>
outmsxml.createnode(1,"INTERFACE_VERSION_NUMBER","http://www.www.www/NS/2001
> -01-10")
> headernode.appendchild(ivnnode)
> ivnnode.text = "6.00"
>
>
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
