Diff for /Amaya/amaya/fetchXMLname.c between versions 1.81 and 1.82

version 1.81, 2005/11/25 13:02:08 version 1.82, 2005/11/28 11:44:52
Line 190  SSchema GetXMLSSchema (int XMLtype, Docu Line 190  SSchema GetXMLSSchema (int XMLtype, Docu
     return NULL;      return NULL;
 }  }
   
   /*--------------------------------------------------------------------------
     HasNatures
     Check if there are MathML and/or SVG natures
     --------------------------------------------------------------------------*/
   void HasNatures (Document document, ThotBool *useMathML, ThotBool *useSVG)
   {
     SSchema         nature;
     char           *ptr;
   
     /* look for a MathML or SVG nature within the document */
     nature = NULL;
     *useMathML = FALSE;
     *useSVG = FALSE;
     do
       {
         TtaNextNature (document, &nature);
         if (nature)
           {
             ptr = TtaGetSSchemaName (nature);
             if (!strcmp (ptr, "MathML"))
               *useMathML = TRUE;
             if (!strcmp (ptr, "SVG"))
               *useSVG = TRUE;
           }
       }
     while (nature);
   }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
   MapXMLElementType    MapXMLElementType
   Generic function which searchs in the Element Mapping table, selected    Generic function which searchs in the Element Mapping table, selected
Line 603  char *GetXMLAttributeName (AttributeType Line 631  char *GetXMLAttributeName (AttributeType
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
   HasADoctype returns TRUE if the document includes a DocType    HasADoctype returns TRUE if the document includes a DocType
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 void HasADoctype (Document doc, ThotBool *found)  void HasADoctype (Document doc, ThotBool *found, ThotBool *useMath)
 {  {
   Element         el_doc, el_doctype;    Element         el_doc, el_doctype;
   ElementType     elType;    ElementType     elType;
   char           *s;    char           *s;
     ThotBool        useSVG;
   
   /* Look for a doctype */    /* Look for a doctype */
   el_doc = TtaGetMainRoot (doc);    el_doc = TtaGetMainRoot (doc);
Line 624  void HasADoctype (Document doc, ThotBool Line 653  void HasADoctype (Document doc, ThotBool
     elType.ElTypeNum = XML_EL_doctype;      elType.ElTypeNum = XML_EL_doctype;
   el_doctype = TtaSearchTypedElement (elType, SearchInTree, el_doc);    el_doctype = TtaSearchTypedElement (elType, SearchInTree, el_doc);
   *found = (el_doctype != NULL);    *found = (el_doctype != NULL);
     HasNatures (doc, useMath, &useSVG);
 }  }
   
   
Line 684  ThotBool MapXMLEntity (int XMLtype, char Line 714  ThotBool MapXMLEntity (int XMLtype, char
             }              }
         }          }
     }      }
     if (!found && ptr == XhtmlEntityTable)
       // check MathML entities
       return MapXMLEntity (MATH_TYPE, entityName, entityValue);
   return found;    return found;
 }  }
   
Line 709  void MapEntityByCode (int entityValue, D Line 742  void MapEntityByCode (int entityValue, D
       found = FALSE;        found = FALSE;
       while (ptr && !found)        while (ptr && !found)
         {          {
           for (i = 0; ptr[i].charCode >= 0 && !found; i++)            for (i = 0; ptr[i].charCode != 0 && !found; i++)
             found = (ptr[i].charCode == entityValue);              found = (ptr[i].charCode == entityValue);
       
           if (found)            if (found)

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


Webmaster