Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
wxSmith and XML
rcoll:
I have a minor (if unusual) problem.
While developing a new function for wxSmith, I noticed that when I store a wxArrayString as a property, the XML writer stores the entire array to the *.wxs file properly. However, when reading it back in (on the next session) the XML reader compresses multiple space chars into a single space. Normally this is not a problem, but in my case the space chars are significant.
Is there any (simple) way to turn off this behavior?
Thanks,
Ringo
MortenMacFly:
--- Quote from: rcoll on March 26, 2009, 07:07:31 pm ---Is there any (simple) way to turn off this behavior?
--- End quote ---
I'm afraid not. wxSmith uses TinXML for it's resources. The reason for that behaviour lies in TinyXML which (by default) will condense white spaces.
See the interface description to SetCondenseWhiteSpace(...) in tinyxml.h for details. You will realise that this behaviour is also the standard behaviour as proposed (or silently acknowledged) by the XML standard.
BUT: If you really need un-condensed white-spaces, why don't you write a CData element? This should work just fine.
rcoll:
Yes, there are several work-arounds I could use (and will); I was just hoping for a "magic bullet" to save some time.
Thanks,
Ringo
rcoll:
Er ... just a quick question about TinyXML .... shouldn't it be WRITING files with condensed spaces, rather than condensing them on input? If I manually edit the *.wxs file, I can see my wxArrayString stored in all of it's whitespace glory; it's only when reading it back in that the white space is condensed. Or am I confused (would not be the first time)?
Ringo
MortenMacFly:
--- Quote from: rcoll on March 26, 2009, 10:58:41 pm ---Or am I confused (would not be the first time)?
--- End quote ---
Now you got me confused. :-)
I need some more info:
- Are you using wxSmith and/or ConfigManager to read/write to the wxs file?
- Can you provide a sample wxs file with an array string?
Navigation
[0] Message Index
[#] Next page
Go to full version