SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I deal with infopath forms with client object model and now I want to add new nodes to the xml, I had goten something with the code below:

         XmlNamespaceManager nameSpaceManager = new XmlNamespaceManager(xd.NameTable);
      nameSpaceManager.AddNamespace("my", "");

      using (XmlWriter writer = xd.CreateNavigator().SelectSingleNode("/my:myFields/my:imagesGroup", nameSpaceManager).AppendChild())

      writer.WriteElementString("field12", "my", "http://S_IMAGES/0.jpg");
      writer.WriteElementString("imageUploaded", "my", "http://S_IMAGES/140370.jpg");


      and the xml I got:

          <my:imageUploaded my:field14="">http://s/1403545158770.jpg</my:imageUploaded>
        <imageItem xmlns="my">

you can see that the first imageItem is ok (is from the original xml) and got my: before every field but the second one that I have generated has no the "my:", if i try to use it in the code it says me that the character is not posssible to use

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.