phpDocumentor SpoolTemplate
[ Back ] [ class tree: SpoolTemplate ] [ index: SpoolTemplate ] [ all elements ]

Source for file sptpl_GlobalFunc.php

Documentation is available at sptpl_GlobalFunc.php

  1. <?php
  2. /*
  3. * sptpl_GlobalFunc.php
  4. *
  5. * This module contains some global functions used by many classes.
  6. * @copyright sptpl_GlobalFunc.php is part of Sptpl project {@link http://www.andrioli.com/en/sptpl.html} and it is LGPL
  7. * @author Andrioli Darvin <darvin (inside) andrioli (dot) com>
  8. * @version $Header: d:\cvs/classistd/sptpl/sptpl_GlobalFunc.php,v 2.2 2005/03/02 21:00:54 Darvin Exp $
  9. */
  10. /*
  11. * +-------------------------------------------------------------------------+
  12. * | Sptpl |
  13. * +-------------------------------------------------------------------------+
  14. * | Copyright (c) 2003-2005 Andrioli Darvin |
  15. * | Email <darvin (inside) andrioli (dot) com> |
  16. * | Web http://www.andrioli.com/en/sptpl.html |
  17. * | Download http://www.phpclasses.org/browse.html/package/1326.html |
  18. * | |
  19. * +-------------------------------------------------------------------------+
  20. * | This library is free software; you can redistribute it and/or modify |
  21. * | it under the terms of the GNU Lesser General Public License as |
  22. * | published by the Free Software Foundation; either version 2 of the |
  23. * | License, or (at your option) any later version. |
  24. * | |
  25. * | This library is distributed in the hope that it will be useful, but |
  26. * | WITHOUT ANY WARRANTY; without even the implied warranty of |
  27. * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
  28. * | Lesser General Public License for more details. |
  29. * | |
  30. * | You should have received a copy of the GNU Lesser General Public |
  31. * | License along with this library; if not, write to the Free Software |
  32. * | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
  33. * +-------------------------------------------------------------------------+
  34. */
  35.  
  36.  
  37.  
  38. /**
  39. * Return the text for the specified node.
  40. *
  41. * @param object node data field name
  42. * @access global
  43. */
  44. function GetDomValue1($Node)
  45. {
  46. if(!is_object($Node))
  47. trigger_error('Internal error: GetDomValue, first parameter must be an object',E_USER_ERROR);
  48. $Text="";
  49. $child = $Node->first_child();
  50. while($child) {
  51. // echo '<br>child:';
  52. // print_r($child);
  53. if($child->node_type()==XML_TEXT_NODE
  54. || $child->node_type()==XML_CDATA_SECTION_NODE ) {
  55. // echo '<br>--&gt;'.nl2br($child->node_value()).'&lt;--';
  56. // echo '<br>++&gt;'.nl2br(preg_replace("/^[ ]*\n/","=",$pippo)).'&lt;++';
  57. $preg_out=preg_replace("/^[ ]*\n/","",$child->node_value());
  58. $Text.=rtrim($preg_out);
  59. }
  60. $child = $child->next_sibling();
  61. }
  62. // echo '<br>++&gt;'.nl2br($Text).'&lt;++';
  63. return($Text);
  64. }
  65.  
  66. ?>

Documentation generated on Mon, 28 Mar 2005 15:13:24 +0200 by phpDocumentor 1.3.0RC3