Skip to content
Discussion options

You must be logged in to vote

xml_document::empty is misleading, it's just xml_node::empty that is inherited. It means "is this node a null node" (see https://pugixml.org/docs/manual.html#dom.cpp); a document is never a null node.

What you want is "does the document have no nodes?", which can be checked via doc.first_child().empty().

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Mr-zhangyh
Comment options

@Mr-zhangyh
Comment options

Answer selected by Mr-zhangyh
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