Hi all,
I’m new to XML and am finding the xml libraries very powerful but a little confusing for my application. I guess it’s just because I don’t understand the terminology specific to what I’m trying to do.
Basically I’m trying to replicate the following packet:
???<?xml version="1.0" encoding="utf-8"?> ?? ERX Message! Free config!?? ?? ?? ?? ?? 125?? ??
The issue I’m having is that certain bytes and elements are not easy to replicate?
ie, how do I add the:
ERX Message! Free config!
The rest of the lines are fine such as:
Sen = root.AppendChild(xml.CreateElement(“RKorr”))
Sen.SetAttribute(“X”, “0”)
Sen.SetAttribute(“Y”, “0”)
Sen.SetAttribute(“Z”, “0”)
Sen.SetAttribute(“A”, “0”)
Sen.SetAttribute(“B”, “0”)
Sen.SetAttribute(“C”, “0”)
The other issue I have is that I can’t replicate the generated whitespace (i.e. carriage returns and line feeds as seen in the attached hex dump of the file.
For example the first three bytes? I’m not even sure what they are supposed to be!
EF BB BF 3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D 22 31 2E 30 22 20 65 6E 63 6F 64 69 6E 67 3D 22 75 74 66 2D 38 22 3F 3E 3C 53 65 6E 20 54 79 70 65 3D 22 49 6D 46 72 65 65 22 3E 20 20 20 0D 0A 20 20 20 3C 45 53 74 72 3E 45 52 58 20 4D 65 73 73 61 67 65 21 20 46 72 65 65 20 63 6F 6E 66 69 67 21 3C 2F 45 53 74 72 3E 0D 0A 20 20 20 3C 52 4B 6F 72 72 20 58 3D 22 30 22 20 59 3D 22 30 22 20 5A 3D 22 30 22 20 41 3D 22 30 22 20 42 3D 22 30 22 20 43 3D 22 30 22 20 2F 3E 0D 0A 20 20 20 3C 41 4B 6F 72 72 20 41 31 3D 22 30 22 20 41 32 3D 22 30 22 20 41 33 3D 22 30 22 20 41 34 3D 22 30 22 20 41 35 3D 22 30 22 20 41 36 3D 22 30 22 20 2F 3E 0D 0A 20 20 20 3C 45 4B 6F 72 72 20 45 31 3D 22 30 2E 30 30 30 30 22 20 45 32 3D 22 30 2E 30 30 30 30 22 20 45 33 3D 22 30 2E 30 30 30 30 22 20 45 34 3D 22 30 2E 30 30 30 30 22 20 45 35 3D 22 30 2E 30 30 30 30 22 20 45 36 3D 22 30 2E 30 30 30 30 22 20 2F 3E 0D 0A 20 20 20 3C 54 65 63 68 20 54 32 31 3D 22 31 2E 30 39 22 20 54 32 32 3D 22 32 2E 30 38 22 20 54 32 33 3D 22 33 2E 30 37 22 20 54 32 34 3D 22 34 2E 30 36 22 20 54 32 35 3D 22 35 2E 30 35 22 20 54 32 36 3D 22 36 2E 30 34 22 20 54 32 37 3D 22 37 2E 30 33 22 20 54 32 38 3D 22 38 2E 30 32 22 20 54 32 39 3D 22 39 2E 30 31 22 20 54 32 31 30 3D 22 31 30 2E 30 30 22 20 2F 3E 0D 0A 20 20 20 3C 44 69 4F 3E 31 32 35 3C 2F 44 69 4F 3E 0D 0A 20 20 20 3C 49 50 4F 43 3E 34 32 31 39 36 33 37 35 37 36 3C 2F 49 50 4F 43 3E 0D 0A 3C 2F 53 65 6E 3E
Thanks heaps,
James