New topic: XMl help ...
<http://forums.realsoftware.com/viewtopic.php?t=25806> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message raimon Post subject: XMl help ...Posted: Mon Dec 29, 2008 9:37 am Joined: Thu Sep 21, 2006 11:56 am Posts: 80 Hello, I have to create this XML file: Code:?xml version="1.0" encoding="UTF-8"?> <CARGA> <METADATA_REG> <ATTRIBUTES> <ATTRIBUTE NAME="test_1" VALUE="1234"/> <ATTRIBUTE NAME="test_2" VALUE="134"/> </ATTRIBUTES> <PROTOCOL>9876</PROTOCOL> </METADATA_REG> </CARGA> I can create all of it except I don't know how to add the 9876 between the <PROTOCOL> tag, I always end with something like this: <PROTOCOL 9876=""/> ... wich part of the XML I should use ? Code:Dim xml as XmlDocument Dim carga, METADATA_REG, attributs, atribut,protocol,protocol_id as XMLNode Dim attr as XMLAttribute xml = New XmlDocument carga = xml.AppendChild(xml.CreateElement("CARGA")) METADATA_REG = carga.AppendChild(xml.CreateElement("METADATA_REG")) attributs = METADATA_REG.AppendChild(xml.CreateElement("ATTRIBUTES")) atribut = attributs.AppendChild(xml.CreateElement("ATTRIBUTE")) attr = XML.CreateAttribute("test_1") attr.value = "2340" atribut.SetAttributeNode(attr) attr = XML.CreateAttribute("test_2") attr.value = "oficina" atribut.SetAttributeNode(attr) protocol_id = xml.CreateElement("PROTOCOL") protocol_id.SetAttribute("98765","") protocol=METADATA_REG.AppendChild(protocol_id) EditField1.Text=xml.ToString thanks, r. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 900 classes with 18000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v8.1. <http://www.monkeybreadsoftware.de/realbasic/plugins.shtml> [email protected]
