Is there any suggestion about it? Thank you for reading and replies. When you load the xml file into an XmlDocument, you don't need a separate writer. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Asked 11 years, 9 months ago. Active 2 years, 10 months ago. Viewed k times. UTF8 ; I practiced the code below. But failed to save my XML file. SelectSingleNode "descendant::books" ; Close ; doc.
Improve this question. Seva 1, 1 1 gold badge 15 15 silver badges 22 22 bronze badges. What node are you trying to retrieve?
Could you post some of the xml you are using? I am not aware of descendant::books xpath syntax. Add a comment. Active Oldest Votes. SelectSingleNode "descendant::books" ; myNode.
Improve this answer. Using LINQ to xml if you are using framework 3. Load "books. Elements "catalog". Attribute "attr1". Save "books.
Matthias 7, 6 6 gold badges 53 53 silver badges 86 86 bronze badges. Kashan Kashan 9 9 silver badges 15 15 bronze badges. UTF8 ; xmlw. WriteStartDocument ; xmlw. WriteStartElement "examtimes" ; xmlw. Asked 13 years, 1 month ago. Active 3 years, 7 months ago. Viewed k times. Improve this question. Mike Mike. To put it succintly: plz send teh codez. Add a comment. Active Oldest Votes. Improve this answer. Gentle 87 10 10 bronze badges. El Padrino El Padrino 1, 1 1 gold badge 11 11 silver badges 25 25 bronze badges.
Using LINQ to xml if you are using framework 3. Load "books. Elements "catalog". Attribute "attr1". Save "books. Really good one infact! CreateAttribute "name" ; attr. Ahmad Ahmad 6, 8 8 gold badges 57 57 silver badges bronze badges. This ended up being my solution to a similar problem: using System; using System. Generic; using System. Linq; using System. Text; using System. Tasks; using System. Empty element.
Attribute attributeName! Contains element. Attribute attributeName.
0コメント