xmldata.c 790 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*====================================================================*
  2. *
  3. * struct node const * xmldata (struct node const * node);
  4. *
  5. * node.h
  6. *
  7. * search an element node for the next data node and return the
  8. * data node address;
  9. *
  10. * Motley Tools by Charles Maier;
  11. * Copyright (c) 2001-2006 by Charles Maier Associates;
  12. * Licensed under the Internet Software Consortium License;
  13. *
  14. *--------------------------------------------------------------------*/
  15. #ifndef XMLDATA_SOURCE
  16. #define XMLDATA_SOURCE
  17. #include <string.h>
  18. #include "../nodes/node.h"
  19. struct node const * xmldata (struct node const * node)
  20. {
  21. if (node)
  22. {
  23. node = node->below;
  24. }
  25. while (node)
  26. {
  27. if (node->type == NODE_DATA)
  28. {
  29. break;
  30. }
  31. node=node->after;
  32. }
  33. return (node);
  34. }
  35. #endif