Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » Change in XmlParser
Change in XmlParser [message #29087] Mon, 04 October 2010 20:22
mirek is currently offline  mirek
Messages: 13975
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

Previous Topic: Box2D plugin
Next Topic: Utimate++ in Teaching
Goto Forum:
  


Current Time: Mon Apr 29 07:19:51 CEST 2024

Total time taken to generate the page: 0.02603 seconds