From: Carsten N. <car...@gm...> - 2010-04-13 20:27:13
|
Hello, attached patch modifies the tokenizer to preserve newlines in cdata. The way I understand the xml spec that is what is intended there. The test still pass, but cdata may now contain some trailing whitespace - not sure if that is a problem though [1]. FWIW my use case was that we had some shader code stored in an xml file that I wanted to read with cppdom, but since the newlines got removed from things like: <fragment_program> #ifdef HAS_NORMAL_MAP // read normal from normal map texture #endif </fragment_program> the preprocessor conditionals stopped working correctly. An alternative would be to support the "<![CDATA[" "]]>" construct, but that seemed to require a better understanding of the interaction between tokenizer and parser. Cheers, Carsten [1] The whitespace comes from the indention of </some_tag>: <root> <some_tag> cdata here </some_tag> </root> i.e. the cdata string is: "cdata_here\n ". |