xmltest.cpp 844 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "tinyxml2.h"
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. using namespace tinyxml2;
  5. int main( int argc, const char* argv )
  6. {
  7. #if 0
  8. {
  9. static const char* test = "<!--hello world-->";
  10. XMLDocument doc;
  11. doc.Parse( test );
  12. doc.Print( stdout );
  13. }
  14. {
  15. static const char* test = "<!--hello world\n"
  16. " line 2\r"
  17. " line 3\r\n"
  18. " line 4\n\r"
  19. " line 5\r-->";
  20. XMLDocument doc;
  21. doc.Parse( test );
  22. doc.Print( stdout );
  23. }
  24. #endif
  25. {
  26. static const char* test[] = { //"<element />",
  27. "<element></element>",
  28. 0
  29. };
  30. for( const char* t=test[0]; *t; ++t ) {
  31. XMLDocument doc;
  32. doc.Parse( t );
  33. doc.Print( stdout );
  34. }
  35. }
  36. return 0;
  37. }