Re: Proper whitespace formatting in mini_xml_karma.cpp example code
Maarten Verhage <[email protected]> Sat, 21 Apr 2018 17:22:07 +0000
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <AM5P192MB01315D86687A48D056B7A191BA8B0@AM5P192MB0131.EURP192.PROD.OUTLOOK.COM> |
----- Original Message ----- From: "Maarten Verhage" <[email protected]> To: "Spirit General" <[email protected]> Sent: Tuesday, April 17, 2018 08:52 Subject: [Spirit-general] Proper whitespace formatting in mini_xml_karma.cpp example code > Dear people, > > I'm using some CAD software tool that produces output that looks a bit > like > xml. Certain values that are produced in these files are undesired in my > perspective. So I wish to change them automatically. Therefore I was > thinking that the mini_xml_karma example code of Spirit 2.5.3 is a good > starting point to write such an utility program. Correct? > > I've done some stuff with Spirit in the past but you still should consider > me a novice on this topic. > > Regarding the mini_xml_karma example code I managed to write the result to > a > file. However the whitespace is removed from it, as was the case with the > original output to std::cout. > > My next objective is to generate proper whitespace. I've no need the > preserve the original line numbers so I can define my own formatting style > for this. I think something like the formatting of the "3.toyxml" file > would > be fine. So, top hierarchy start tags should have a line feed directly > after > it. Any line that follows should have indentation of some spaces until the > end tag. Subsequent start/end tags should be on the same line. > > Do you know of some example code that shows behavior like this? Or which > Spirit and/or Karma facilities should I be using to implement this? > > Thank you very much for your attention and time! > > Best regards, > Maarten Verhage > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Spirit-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/spirit-general > Dear Spirit expert, Sure I will admit this mailing list is a great opportunity when somebody can provide advice without getting paid for. So I would highly appreciate somebody who can push me in the right direction regarding the above. How nice would it be to utilize somebody's tried and tested approach to start from. Very much thanks in advance. Best regards, Maarten Verhage ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot