xmlselect.c.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. xmlselect.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='xmlschema.c.html' title=' xmlschema.c '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='xmltree.c.html' title=' xmltree.c '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * char const * xmlselect (struct node const * node, char const * element, char const * attribute);
  24. *
  25. * node.h
  26. *
  27. * search node for the named element and attribute and return the
  28. * attribute value;
  29. *
  30. * if the attribute argument is null or nil then return the element
  31. * content string;
  32. *
  33. * if the element does not exist or the attribute does not exist
  34. * for that element or the attribute has no value then an empty
  35. * string is returned;
  36. *
  37. * Motley Tools by Charles Maier &lt;cmaier@cmassoc.net&gt;;
  38. * Copyright (c) 2001-2006 by Charles Maier Associates;
  39. * Licensed under the Internet Software Consortium License;
  40. *
  41. *--------------------------------------------------------------------*/
  42. #ifndef XMLSELECT_SOURCE
  43. #define XMLSELECT_SOURCE
  44. #include &lt;string.h&gt;
  45. #include &quot;../nodes/node.h&quot;
  46. char const * xmlselect (struct node const * node, char const * element, char const * attribute)
  47. {
  48. node = xmlelement (node, element);
  49. if ((attribute) &amp;&amp; (* attribute))
  50. {
  51. node = xmlattribute (node, attribute);
  52. node = xmlvalue (node);
  53. }
  54. else
  55. {
  56. node = xmldata (node);
  57. }
  58. return (node? node-&gt;text: &quot;&quot;);
  59. }
  60. #endif
  61. </pre>
  62. <div class='footerlink'>
  63. [<a href='xmlschema.c.html' title=' xmlschema.c '>PREV</a>]
  64. [<a href='toolkit.html' title=' Index '>HOME</a>]
  65. [<a href='xmltree.c.html' title=' xmltree.c '>NEXT</a>]
  66. </div>
  67. </body>
  68. </html>