Skip to content

Pugixml get full string containing whitespace #681

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

You must be logged in to vote

Wild guess: second select_node is finding a node that does not correspond to your object that's currently being processed. This is a common XPath gotcha, "//foo" means "go to document root and find all nodes with the name 'foo'". You need auto path_node = name_node.parent().select_node(".//coordinates"); instead.

Otherwise, pugixml should preserve whitespace of text nodes in this case.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by adockendorf
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