Diff for /Amaya/amaya/fetchXMLname.c between versions 1.21 and 1.22

version 1.21, 2000/08/23 16:44:23 version 1.22, 2000/08/28 13:52:09
Line 319  int                XMLtype; Line 319  int                XMLtype;
   
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
    MapXMLElementType    MapXMLElementType
    search in the mapping tables the entry for the element type of name    Generic function which searchs in the Element Mapping table, selected
    XMLname and returns the corresponding Thot element type.    by the parameter XMLtype, the entry XMLname and returns the corresponding
     Thot element type.
    Returns:     Returns:
     - ElTypeNum and ElSSchema inelType  ElTypeNum = 0 if not found.      - ElTypeNum and ElSSchema into elType  ElTypeNum = 0 if not found.
     - content       - content 
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 #ifdef __STDC__  #ifdef __STDC__
Line 367  Document           doc; Line 368  Document           doc;
        /* search in the ElemMappingTable */         /* search in the ElemMappingTable */
        i = 0;         i = 0;
        /* look for the first concerned entry in the table */         /* look for the first concerned entry in the table */
        while (ptr[i].XMLname[0] < XMLname[0] && ptr[i].XMLname[0] != EOS)         while (ptr[i].XMLname[0] < XMLname[0] && ptr[i].XMLname[0] != WC_EOS)
          i++;           i++;
   
        /* look at all entries starting with the right character */         /* look at all entries starting with the right character */
        do         do
          if (ustrcmp (ptr[i].XMLname, XMLname))           if (ustrcmp (ptr[i].XMLname, XMLname) || ptr[i].Level > ParsingLevel[doc])
              /* it's not the tag or this tag is not valid for the current parsing level */
            i++;             i++;
          else           else
            {             {
Line 388  Document           doc; Line 391  Document           doc;
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
    GetXMLElementName     GetXMLElementName
    search in the mapping tables the XML name for a given Thot type     Generic function which searchs in the mapping table the XML name for
      a given Thot type.
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 #ifdef __STDC__  #ifdef __STDC__
 void              GetXMLElementName (ElementType elType, CHAR_T** buffer)  void              GetXMLElementName (ElementType elType, CHAR_T** buffer)
Line 424  CHAR_T**          buffer; Line 428  CHAR_T**          buffer;
               }                }
             i++;              i++;
             }              }
           while (ptr[i].XMLname[0] != EOS);                   while (ptr[i].XMLname[0] != WC_EOS);    
      }       }
    *buffer = TEXT("???");     *buffer = TEXT("???");
    return;     return;
 }  }
   /*----------------------------------------------------------------------
      XmlMapAttribute
      Generic function which searchs in the Attribute Mapping Table (table)
      the entry attrName associated to the element elementName.
      Returns the corresponding entry.
     ----------------------------------------------------------------------*/
   #ifdef __STDC__
   int               XmlMapAttribute (CHAR_T *attrName,
                                      CHAR_T *elementName,
                                      Document doc,
                                      AttributeMapping table[])
   #else
   int               XmlMapAttribute (attrName,
                                      elementName,
                                      doc,
                                      table)
   CHAR_T           *attrName;
   CHAR_T           *elementName;
   Document          doc;
   AttributeMapping  table[];
   #endif
   {
     int             i;
   
     i = 0;
     /* look for the first concerned entry in the table */
     while (table[i].XMLattribute[0] < attrName[0] && table[i].XMLattribute[0] != WC_EOS)
       i++;
     while (table[i].XMLattribute[0] == attrName[0])
       {
         if (table[i].Level > ParsingLevel[doc] ||
             ustrcasecmp (table[i].XMLattribute, attrName) ||
             (table[i].XMLelement[0] != WC_EOS && ustrcasecmp (table[i].XMLelement, elementName)))
           i++;
         else
           return (i);
       }
     return (i);
   }

Removed from v.1.21  
changed lines
  Added in v.1.22


Webmaster