Home » Community » U++ community news and announcements » Change in XmlParser
Change in XmlParser [message #29087] |
Mon, 04 October 2010 20:22 |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
I am putting this here, becase interface behaviour of XmlParser, XmlTag and XmlNode has changed to degree that it is even possible (but unlikely) that some apps would break....
The purpose of change is to handle whitespaces correctly, as was for long time suggested by aftershock. He was right about this and the change had to come.
So here we go:
First of all, for practical purposes and also for good degree of backward compatibility, we now distinguish "all-whitespace" texts (consists only of chars <= 32) and "significant" texts.
In XmlParser, calls to markup consuming functions (like "Tag") are now allowed to skip all-whitespace texts.
XmlParser::ReadText now "works always", returning even "all-whitespace" texts between tags, e.g. line-endings. However, if the parser is at "significant" texts, ReadTexts causes parser to "consume" it. Moreover, all texts are returned "complete" with trailing and leading whitespaces.
IsText method is now changed to indicate "significant" texts.
xml:space = "preserve" or "PreserveAllWhitespaces" now forces ALL non-null texts to be "significant" even if the are "all-whitespace".
There had to be another change in XmlTag - the issue at hand is that fancy block formatting of xml; if the text is multiline, this is detected and block formatting is supresed for that.
So far, the only change I had to do with my code was to remove "PreserveAllWhitespaces" in one case (I believe introducing this mode was a bad idea anyway).
[Updated on: Mon, 04 October 2010 20:25] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Apr 28 01:16:40 CEST 2025
Total time taken to generate the page: 0.01414 seconds
|