Diff for /Amaya/amaya/templateInstantiate.c between versions 1.80 and 1.81

version 1.80, 2008/07/22 09:01:42 version 1.81, 2008/08/06 13:18:48
Line 76  Element Template_InsertRepeatChildAfter Line 76  Element Template_InsertRepeatChildAfter
 #endif /* TEMPLATES */  #endif /* TEMPLATES */
 }  }
   
 /*----------------------------------------------------------------------  
   Template_InsertRepeatChild  
   Insert a child to a xt:repeat  
   The decl parameter must be valid and will not be verified. It must be a  
     direct child element or the "use in the use" for union elements.  
   @param el element (repeat) in which insert a new element  
   @param decl Template declaration of the element to insert  
   @param pos Position of insertion (0 before all, 1 after first ... -1 after all)  
   @return The inserted element  
   ----------------------------------------------------------------------*/  
 Element Template_InsertRepeatChild (Document doc, Element el, Declaration decl, int pos)  
 {  
 #ifdef TEMPLATES  
   if (!TtaGetDocumentAccessMode(doc) || !decl)  
     return NULL;  
   
   if (pos == 0)  
     return Template_InsertRepeatChildAfter (doc, el, decl, NULL);  
   else if (pos == -1)  
     return Template_InsertRepeatChildAfter (doc, el, decl, TtaGetLastChild(el));  
   else  
   {  
     Element elem = TtaGetFirstChild(el);  
     pos--;  
     while (pos > 0)  
       {  
         TtaNextSibling(&elem);  
         pos--;  
       }  
     return Template_InsertRepeatChildAfter (doc, el, decl, elem);  
   }  
 #else /* TEMPLATES */  
   return NULL;  
 #endif /* TEMPLATES */  
 }  
   
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
   Template_InsertBagChild    Template_InsertBagChild

Removed from v.1.80  
changed lines
  Added in v.1.81


Webmaster