Insert a Node by code - InfoPath Dev
in

InfoPath Dev

Insert a Node by code

Last post 07-06-2005 01:01 AM by Giovanni. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-05-2005 10:05 AM

    Insert a Node by code

    I tried to write a new method for insert a new node but it dosen't work. Can you help me?

    Here is my xml:

    myFields
    logGroup
    logEntries
    age
    name

    Here is my code:

    XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-07-05T15:38:25"');


    function CTRL1_5::OnClick(eventObj)
    {
    sRepeatingXml = "<my:logEntries xmlns:my='http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-07-05T15:38:25'><my:name>NameValue</my:name><my:age>3</my:age></my:logEntries>"


    oXml = XDocument.CreateDOM()
    oXml.async = false;
    oXml.loadXML(sRepeatingXml);
    parentofRepeatingNode = getNode("/my:myFields/my:logGroup/my:logEntries");
    parentofRepeatingNode.appendChild(oXml.documentElement);

    }

    Thank you to all...
    Bye Bye
  • 07-05-2005 02:42 PM In reply to

    Hi Giovanni,
    Welcome to the Forum!
    XML node you are creating is "logentries" node and you are appending it to another "Logentries" node which is wrong according to your schema.

    If my assumption is wrong, please paste the error message here so that we can get a better idea of your problem.

    Agni
    InfoPathDev India
  • 07-06-2005 01:01 AM In reply to

    Thank's a lot. Now is all right.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.