Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: "Craig" <brokenleg@-----------.--->
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"
>
>
>
>




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