/****************************************************************************
*
*      Projet  : DilibSxml
*      Module  : Xpath
*      Fichier : XpathTools.c
*      Auteur  : J. Ducloy
*      Origine : J. Ducloy
*
*      Derniere mise a jour Novembre 2000
*      $Id: XpathKernel.c,v 1.2 2003/10/06 14:57:39 parmentf Exp $
*
************************************************************************
* 
*     Copyright (C) 2000 INIST
*
****************************************************************************/
/**
   @file

   @brief Kernel functions for XpathIterators (deprecated)

   This seems to be unused!

   Instead, file SxPathTools.c contains @ref SxPathIterInit, @ref
   SxPathIterCreate, @ref SxPathCreateItem.

   @internal Should it be removed?
   @todo Remove this file
     
   @author &copy; 2000 INIST-CNRS
   @author Jacques DUCLOY <DilibMaster@inist.fr>
 */

#include "SxPath.h"
#include "string.h"


SxmlNode *XpathIteratorCreate()
{
  SxmlNode *iter;
  iter=SxmlElementCreate("stack");
  return iter;
}

/**
   Initializes @a i1 with @a p1 on @a n1.

   @warning @a i1 must have been created with @ref
		XpathIteratorCreate.
   @warning XpathCreateItem does not exist!

   @param i1 iterator
   @param p1 path
   @param n1 node (?)
   @returns ?
 */
SxmlNode *SxPathIterInit(SxmlNode *i1,
		       SxmlNode *p1,
		       SxmlNode *n1)
{
  SxmlNode *bottom;
  SxmlFreeChildren(i1);
  if ((bottom=SxPathCreateItem(p1,n1)))
    {
      SxmlAppendChild (i1, bottom);
      return i1;
    }
  return NULL;
}

