user1986352
user1986352

Reputation: 61

c++ xml string- required white space was missing

I would like to do validate to xml string. I create xml string in c++ The issue is that I receive the error "Required white space was missing". and I see that the "
" is not create the new line as needed. can you please advice, how to do new line in c++ string that the validation will pass?

can you please give me example?

Upvotes: 0

Views: 704

Answers (1)

Jan Hudec
Jan Hudec

Reputation: 76256

To create a literal newline in C++ you write "\n".

The "
" simply writes the entity in the string and entities below 0x20 are not allowed, so this does not substitute newline (actually it depends on the parsing library; some accept it, some don't).

The other thing is why the validation requires the newline to be present, because it shouldn't. Whitespace, newlines included, is either ignored or part of value in XML, but never a syntactic element. Neither XSD nor DTD allow specifying newline would be required, so standard validation tools have no way to care.

Upvotes: 2

Related Questions