Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
<Exceptions>
    <AllowedItems>
      <Item Name="Jellyfish.jpg" Type="2" AddedDate="06/12/2013" User="XYZ" />
    </AllowedItems>
  </Exceptions>


In above xml format, I want to achieve a output like these,

C#
<Exceptions>
    <AllowedItems>
      <Item Type="2" AddedDate="06/12/2013" User="XYZ">"Jellyfish.jpg" </Item>
    </AllowedItems>
  </Exceptions>
Posted
Updated 12-Jun-13 2:31am
v2
Comments
Andy Lanng 12-Jun-13 8:33am    
How are your parsing / creating this XML? XmlDocument? string? Please provide details of what you are doing in code and what you have tried
Thanks ^_^

Check out this one[^]
 
Share this answer
 
Not entirely sure if this is what you're asking for, but you can add text in a node via the InnerText property:

XmlElement item = (XmlElement)doc.SelectSingleNode("//item");

item.InnerText = '"Jellyfish.jpg"';


Can read more here if this is what you're looking for: http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.innertext.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900