Hi!
TinyXML objects have a SetCondenseWhiteSpace method, which compresses all multiple whitespaces into one.
The problem is, it also trims a text, so the following files will have the same meaning (I use [ and ] tags since I'm not sure how SF handles that):
This is [i] italic [/i] text
This is[i]italic[/i]text
It would be a nice feature to have two options:
- whitespace condensation
- text trimming
What's your opinion?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately, like other parts of the specification, it appears self-contradictory:
"An XML processor must always pass all characters in a document that are not markup through to the application."
and
"A special attribute named xml:space may be attached to an element to signal an intention that in that element, white space should be preserved by applications.[..] When declared, it must be given as an enumerated type whose values are one or both of "default" and "preserve". "
So it seems to say "you should always pass white space on", but also seems to say "we provide an attribute so you can tell the processor to pass white space on". Maybe I'm just reading it wrongly, though.
I don't think text trimming should be done; if you strip the tags out of your example, it reads as "isitalictext" rather than "is italic text". Just as in HTML, whitespace is significant - just the amount of it usually is not.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
TinyXML objects have a SetCondenseWhiteSpace method, which compresses all multiple whitespaces into one.
The problem is, it also trims a text, so the following files will have the same meaning (I use [ and ] tags since I'm not sure how SF handles that):
This is [i] italic [/i] text
This is[i]italic[/i]text
It would be a nice feature to have two options:
- whitespace condensation
- text trimming
What's your opinion?
It should follow the specifications at:
http://www.w3.org/TR/REC-xml#sec-white-space.
Unfortunately, like other parts of the specification, it appears self-contradictory:
"An XML processor must always pass all characters in a document that are not markup through to the application."
and
"A special attribute named xml:space may be attached to an element to signal an intention that in that element, white space should be preserved by applications.[..] When declared, it must be given as an enumerated type whose values are one or both of "default" and "preserve". "
So it seems to say "you should always pass white space on", but also seems to say "we provide an attribute so you can tell the processor to pass white space on". Maybe I'm just reading it wrongly, though.
I don't think text trimming should be done; if you strip the tags out of your example, it reads as "isitalictext" rather than "is italic text". Just as in HTML, whitespace is significant - just the amount of it usually is not.