xmltree.c.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. xmltree.c
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='xmlselect.c.html' title=' xmlselect.c '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='xmlvalue.c.html' title=' xmlvalue.c '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * void xmltree (NODE const * node);
  24. *
  25. * node.h
  26. *
  27. * print node structure on stdout;
  28. *
  29. * Motley Tools by Charles Maier &lt;cmaier@cmassoc.net&gt;;
  30. * Copyright (c) 2001-2006 by Charles Maier Associates;
  31. * Licensed under the Internet Software Consortium License;
  32. *
  33. *--------------------------------------------------------------------*/
  34. #ifndef XMLTREE_SOURCE
  35. #define XMLTREE_SOURCE
  36. #include &lt;stdio.h&gt;
  37. #include &quot;../nodes/node.h&quot;
  38. #include &quot;../tools/format.h&quot;
  39. void xmltree (NODE const * node)
  40. {
  41. if (node)
  42. {
  43. node = node-&gt;below;
  44. }
  45. while (node)
  46. {
  47. static unsigned level = 0;
  48. printf (&quot;%03d &quot;, node-&gt;line);
  49. printf (&quot;(%c) &quot;, node-&gt;type);
  50. output (level, &quot;[%s]&quot;, node-&gt;text);
  51. level++;
  52. xmltree (node);
  53. level--;
  54. node = node-&gt;after;
  55. }
  56. return;
  57. }
  58. #endif
  59. </pre>
  60. <div class='footerlink'>
  61. [<a href='xmlselect.c.html' title=' xmlselect.c '>PREV</a>]
  62. [<a href='toolkit.html' title=' Index '>HOME</a>]
  63. [<a href='xmlvalue.c.html' title=' xmlvalue.c '>NEXT</a>]
  64. </div>
  65. </body>
  66. </html>