In the first example (element1), there is no text element, and GetText should return a null char* pointer (it does).
In the second example though (element2), there _is a text element, it just so happens to be empty text… In this case, I think the correct behaviour for GetText would be to return a non-null pointer to an empty string "" {'\0'}. It currently just returns a null-pointer.
The difference is subtle, but neccesarry to tell appart a self-closing element, from an element who's text is "empty text".
PS: Thank you so much for this library ;)_
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think the behaviour for GetText is wrong:
In the first example (element1), there is no text element, and GetText should return a null char* pointer (it does).
In the second example though (element2), there _is a text element, it just so happens to be empty text… In this case, I think the correct behaviour for GetText would be to return a non-null pointer to an empty string "" {'\0'}. It currently just returns a null-pointer.
The difference is subtle, but neccesarry to tell appart a self-closing element, from an element who's text is "empty text".
PS: Thank you so much for this library ;)_