<?xml version="1.0" encoding="UTF-8"?> <Authentication username="testuser" password="ECLPASS"/> <Hotel id="411"/> <AvailRateUpdate>
<Authentication username="testuser" password="ECLPASS"/> this line but add new noad hotel then it can be inside of <authentication username="testuser" password="ECLPASS"> <hotel id="411" /> </authentication> How to solve this or how to create hotelid after the authentication completes my code below XmlTextWriter writer = new XmlTextWriter(Server.MapPath ("product.xml"), System.Text.Encoding.UTF8); XmlDocument doc = new XmlDocument(); writer.WriteStartDocument(true); writer.Formatting = Formatting.Indented; XmlNode AuthenticationNode = doc.CreateElement("Authentication"); XmlAttribute UserName = doc.CreateAttribute("id"); UserName.Value = "eqcuser"; XmlAttribute password = doc.CreateAttribute("Password"); password.Value = "eqcpass"; AuthenticationNode.Attributes.Append(UserName); AuthenticationNode.Attributes.Append(password); doc.AppendChild(AuthenticationNode); XmlNode root = doc.CreateElement("Hotel"); XmlAttribute HotelNode = doc.CreateAttribute("Id"); HotelNode.Value = "36972"; root.Attributes.Append(HotelNode); doc.AppendChild(root);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)