c++ - Does RapidXML support xml:space="preserve"? -


i'm reading xml file have "whitespace-only text nodes":

<p>i <b>love</b> <i>mozart</i>.</p> 

in above (simplified) example, there whitespace (a single space) between end tag , start tag. need preserve space.

when parsing in rapidxml, specifying "parse_comment_nodes", assume "parse_trim_whitespace" , "parse_normalize_whitespace" not in effect. i'm attempting use "xml:space" syntax:

<p xml:space="preserve">i <b>love</b> <i>mozart</i>.</p> 

...but seems if rapidxml doesn't respect that. loop through sibling nodes, never see node value of " ".

i've been reading (and re-reading) documentation, , searching here on stackoverflow, far haven't figured out if syntax issue on part, or rapidxml issue.

now i'm positive rapidxml 1.13 doesn't support working around whitespace-only text nodes using xml:space="preserve" attribute. located patch issue on sourceforge:

link patch rapidxml 1.13 whitespace-only text node bug

this patch corrects problem of rapidxml never returning/skipping valid node when contained whitespace. not enable use of xml:space="preserve" attribute. preferable method of enabling bugfix. perhaps more familiar rapidxml project can make change in future.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -