Actually I want to find a general way to handle the XML modification, don't
care what is the style or what is in the XML.

在 2013年1月29日星期二UTC+8下午10时27分09秒,nvcnvn写道:
Look like you are storing a map with that XML.
What is the struct that marshaled to the XML?

If you use JSON that will be easy as you can marshal a Go map.

Vào 19:07:53 UTC+7 Thứ ba, ngày 29 tháng một năm 2013, axe đã viết:

I met a problem about modification with a node in a unknown-size XML
file. e.g., I have such a XML

<string name="group">golang-nuts</string>
<string name="purpose">go language</string>

Now I want to find the node with name="porpose" and change it to
'golang'. However I just know how to marshal or unmarshal the xml. How can
i find the node then modify it and save the new data to xml? In case I only
use standard go pkgs.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 8 | next ›
Discussion Overview
groupgolang-nuts @
postedJan 29, '13 at 12:07p
activeJan 31, '13 at 4:43p



site design / logo © 2021 Grokbase