Hi,
I am trying to parse an existing XML, present certain fields for editing and write out a replacement.
I have the parsing working, started on "presenting" the fields, and thought I'd better check to see if I can duplicate what I have with the xmlbuilder.
I tend to copy pieces of code from questions regarding whatever I'm trying to do but the xmlbuilder content is kind of sparse. I looked at the library page, it has more options than were ever mentioned in any question.
I am able to produce lines like this:
<name>Win10</name>
But I am having trouble with the attributes like this:
<topology sockets='1' cores='2' threads='1'/>
Naturally there is a mixture of both in the XML (attached)
As you can see it's a VM definition file, which needs to be XML.
I'm still just testing, so for the xmlbuilder I have this copied from an old question. I didn't want to necro-post, so I started new. It's not personalized for me yet (seemed pretty generic tho):
Thanks!
Eric
I am trying to parse an existing XML, present certain fields for editing and write out a replacement.
I have the parsing working, started on "presenting" the fields, and thought I'd better check to see if I can duplicate what I have with the xmlbuilder.
I tend to copy pieces of code from questions regarding whatever I'm trying to do but the xmlbuilder content is kind of sparse. I looked at the library page, it has more options than were ever mentioned in any question.
I am able to produce lines like this:
<name>Win10</name>
But I am having trouble with the attributes like this:
<topology sockets='1' cores='2' threads='1'/>
Naturally there is a mixture of both in the XML (attached)
As you can see it's a VM definition file, which needs to be XML.
I'm still just testing, so for the xmlbuilder I have this copied from an old question. I didn't want to necro-post, so I started new. It's not personalized for me yet (seemed pretty generic tho):
B4X:
sub xml
Dim x As XMLBuilder
x = x.create("Data")
x = x.element("Field") _
.element("id").text("01") _
.up() _
.element("job_no").text("A001")
Dim props As Map
props.Initialize
props.Put("indent", "yes")
File.WriteString(File.DirRootExternal, "create.xml", x.asString2(props))
End Sub
Thanks!
Eric