escape_xml.c 375 B

12345678910111213141516171819202122232425
  1. /*****************************************************************
  2. * Must be used with Expat compiled for UTF-8 output.
  3. */
  4. #include <iostream>
  5. #include "../expat_justparse_interface.h"
  6. using namespace std;
  7. int main(int argc, char *argv[])
  8. {
  9. char c;
  10. string buf;
  11. while (!cin.eof())
  12. {
  13. cin.get(c);
  14. buf += c;
  15. }
  16. cout<<escape_xml(buf);
  17. return 0;
  18. }