-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need an AddElement method #17
Comments
Thanks a lot Brett! Could you create a temp tag so that I can pull it from gopkg.in? Update, I took a look at the code, and I totally like your new changes. If you create a temp tag, I can do Thanks |
It's already got a tag: v0 |
sorry, didn't know that. will try this evening... |
Yep, that's exactly what I was hoping for. Thanks! |
You meant, "If element el was already the child of another element under the same root, it is removed from its current parent element first", right? I meant,
After this loop, the docA will stay the same, without any node being removed, right? provided that |
In that code, docA would be modified, since an element cannot be in two different trees. To keep docA from being modified, you should do |
well, actually I hope not. Check this out,
|
Found the bug. Please see the pull request. (I'll be adding all comments to the PR from now on.) |
Gotya. I'm all good now. |
Hi Brett, Would you take a look at https://github.com/suntong/lang/blob/master/lang/Go/src/xml/et_example.go please? That's the code I tested the above feature and fix, and was good with the tag Thanks |
I need a way to add an etree Element under another etree Element.
Trying to explain in code:
Now the
root
is an etree Element under which are a bunch of<book>
XML Elements.Suppose now I have
The question is how can I add
docMore
as new entries under theroot
etree Element?I think such feature would be needed by others as well. Please consider adding it.
Thanks
The text was updated successfully, but these errors were encountered: