Diff for /Amaya/amaya/templateInstantiate.c between versions 1.53 and 1.54

version 1.53, 2007/10/24 13:35:08 version 1.54, 2007/11/09 16:18:56
Line 192  void  CreateInstance(char *templatePath, Line 192  void  CreateInstance(char *templatePath,
   DocumentType      docType;    DocumentType      docType;
   ElementType       elType;    ElementType       elType;
   Element           root, title, text;    Element           root, title, text;
   char             *localFile, *s;    CHARSET           charset;
     char             *localFile, *s, *charsetname;
   
   XTigerTemplate t = GetXTigerTemplate(templatePath);    XTigerTemplate t = GetXTigerTemplate(templatePath);
   if (t == NULL)    if (t == NULL)
Line 208  void  CreateInstance(char *templatePath, Line 209  void  CreateInstance(char *templatePath,
     newdoc = TtaGetNextDocumentIndex ();      newdoc = TtaGetNextDocumentIndex ();
   else    else
     newdoc = basedoc;      newdoc = basedoc;
 #ifndef IV  
   localFile = GetLocalPath (newdoc, instancePath);    localFile = GetLocalPath (newdoc, instancePath);
 #else  
   localFile = TtaStrdup (instancePath);  
 #endif  
   if (!TtaPrepareUndo (doc))    if (!TtaPrepareUndo (doc))
     {      {
       TtaOpenUndoSequence (doc, NULL, NULL, 0, 0);        TtaOpenUndoSequence (doc, NULL, NULL, 0, 0);
Line 265  void  CreateInstance(char *templatePath, Line 263  void  CreateInstance(char *templatePath,
                 // Look for the first text child                  // Look for the first text child
                 TtaNextSibling (&text);                  TtaNextSibling (&text);
             }              }
           
             // update the charset if needed
             charsetname = TtaGetEnvString ("DOCUMENT_CHARSET");
             charset = TtaGetCharset (charsetname);
             if (charset != UNDEFINED_CHARSET && strcmp (charsetname, DocumentMeta[doc]->charset))
               {
                 TtaSetDocumentCharset (doc, charset, FALSE);
                 DocumentMeta[doc]->charset = TtaStrdup (charsetname);
                 SetNamespacesAndDTD (doc);
               }
   
             // export the document
           if (TtaGetDocumentProfile(doc) == L_Xhtml11 ||            if (TtaGetDocumentProfile(doc) == L_Xhtml11 ||
               TtaGetDocumentProfile(doc) == L_Basic)                TtaGetDocumentProfile(doc) == L_Basic)
             TtaExportDocumentWithNewLineNumbers (doc, localFile, "HTMLT11");              TtaExportDocumentWithNewLineNumbers (doc, localFile, "HTMLT11");
Line 280  void  CreateInstance(char *templatePath, Line 290  void  CreateInstance(char *templatePath,
       TtaUndoNoRedo (doc);        TtaUndoNoRedo (doc);
       TtaClearUndoHistory (doc);        TtaClearUndoHistory (doc);
       RemoveParsingErrors (doc);        RemoveParsingErrors (doc);
   
 #ifndef IV  
       GetAmayaDoc (instancePath, NULL, basedoc, basedoc, CE_INSTANCE,        GetAmayaDoc (instancePath, NULL, basedoc, basedoc, CE_INSTANCE,
                    !DontReplaceOldDoc, NULL, NULL);                     !DontReplaceOldDoc, NULL, NULL);
       TtaSetDocumentModified (newdoc);        TtaSetDocumentModified (newdoc);
 #else  
       CallbackDialogue (BaseDialog + OpenForm, INTEGER_DATA, (char *) 1);  
 #endif  
     }      }
   TtaFreeMemory (localFile);    TtaFreeMemory (localFile);
 #endif /* TEMPLATES */  #endif /* TEMPLATES */
Line 1022  void DoInstanceTemplate (char *templaten Line 1027  void DoInstanceTemplate (char *templaten
   XTigerTemplate  t;    XTigerTemplate  t;
   ElementType     elType;    ElementType     elType;
   Element         root, piElem, doctype, elFound, text;    Element         root, piElem, doctype, elFound, text;
     Document        doc;
   char           *s, *charsetname = NULL, buffer[MAX_LENGTH];    char           *s, *charsetname = NULL, buffer[MAX_LENGTH];
   int             pi_type;    int             pi_type;
   Document        doc;  
   
   //Instantiate all elements    //Instantiate all elements
   t = GetXTigerTemplate(templatename);    t = GetXTigerTemplate(templatename);
Line 1066  void DoInstanceTemplate (char *templaten Line 1071  void DoInstanceTemplate (char *templaten
       elType.ElTypeNum = XML_EL_doctype;        elType.ElTypeNum = XML_EL_doctype;
       pi_type = XML_EL_xmlpi;        pi_type = XML_EL_xmlpi;
     }      }
   
   doctype = TtaSearchTypedElement (elType, SearchInTree, root);    doctype = TtaSearchTypedElement (elType, SearchInTree, root);
   if (!doctype)    if (!doctype)
     {      {

Removed from v.1.53  
changed lines
  Added in v.1.54


Webmaster