xmlelement.c.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. xmlelement.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='xmledit.c.html' title=' xmledit.c '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='xmlfree.c.html' title=' xmlfree.c '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * struct node * xmlelement (struct node const * node, char const * name);
  24. *
  25. * node.h
  26. *
  27. * search node for the named element node; return the node address;
  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 XMLELEMENT_SOURCE
  35. #define XMLELEMENT_SOURCE
  36. #include &lt;string.h&gt;
  37. #include &quot;../nodes/node.h&quot;
  38. struct node const * xmlelement (struct node const * node, char const * name)
  39. {
  40. if (node)
  41. {
  42. node = node-&gt;below;
  43. }
  44. while (node)
  45. {
  46. if (node-&gt;type == NODE_ELEM)
  47. {
  48. struct node const * temp;
  49. if (!strcmp (node-&gt;text, name))
  50. {
  51. break;
  52. }
  53. temp = xmlelement (node, name);
  54. if (temp)
  55. {
  56. return (temp);
  57. }
  58. }
  59. node=node-&gt;after;
  60. }
  61. return (node);
  62. }
  63. #endif
  64. </pre>
  65. <div class='footerlink'>
  66. [<a href='xmledit.c.html' title=' xmledit.c '>PREV</a>]
  67. [<a href='toolkit.html' title=' Index '>HOME</a>]
  68. [<a href='xmlfree.c.html' title=' xmlfree.c '>NEXT</a>]
  69. </div>
  70. </body>
  71. </html>