Skip to content

How could I add a parent to a node? #628

Closed Answered by zeux
stereomatchingkiss asked this question in Q&A
Discussion options

You must be logged in to vote

append_child + append_move for all other children of measure; see https://pugixml.org/docs/manual.html#modify.move

Note that you will need to be careful about iterating, as append_move changes the sibling structure; you could do something like

pugi::xml_node staff = measure.append_child("staff");
while (measure.first_child() != staff)
    staff.append_move(measure.first_child());

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@stereomatchingkiss
Comment options

Answer selected by stereomatchingkiss
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants