version 1.14, 1998/08/05 01:47:48
|
version 1.15, 1998/08/05 19:13:29
|
Line 108 xmlDocPtr xmlNewDoc(const CHAR *version)
|
Line 108 xmlDocPtr xmlNewDoc(const CHAR *version)
|
cur->version = xmlStrdup(version); |
cur->version = xmlStrdup(version); |
cur->root = NULL; |
cur->root = NULL; |
cur->dtds = NULL; |
cur->dtds = NULL; |
|
cur->encoding = NULL; |
|
cur->standalone = -1; |
return(cur); |
return(cur); |
} |
} |
|
|
Line 120 void xmlFreeDoc(xmlDocPtr cur) {
|
Line 122 void xmlFreeDoc(xmlDocPtr cur) {
|
return; |
return; |
} |
} |
free((char *) cur->version); |
free((char *) cur->version); |
|
if (cur->encoding != NULL) free((char *) cur->encoding); |
if (cur->root != NULL) xmlFreeNode(cur->root); |
if (cur->root != NULL) xmlFreeNode(cur->root); |
if (cur->dtds != NULL) xmlFreeDtdList(cur->dtds); |
if (cur->dtds != NULL) xmlFreeDtdList(cur->dtds); |
memset(cur, -1, sizeof(xmlDoc)); |
memset(cur, -1, sizeof(xmlDoc)); |
Line 710 void xmlDocDumpMemory(xmlDocPtr cur, CHA
|
Line 713 void xmlDocDumpMemory(xmlDocPtr cur, CHA
|
else |
else |
xmlBufferWriteChar("<?xml version=\""); |
xmlBufferWriteChar("<?xml version=\""); |
xmlBufferWriteCHAR(cur->version); |
xmlBufferWriteCHAR(cur->version); |
xmlBufferWriteChar("\"?>\n"); |
xmlBufferWriteChar("\""); |
|
if (cur->encoding != NULL) { |
|
xmlBufferWriteChar(" encoding=\""); |
|
xmlBufferWriteCHAR(cur->encoding); |
|
xmlBufferWriteChar("\""); |
|
} |
|
switch (cur->standalone) { |
|
case 0: |
|
xmlBufferWriteChar(" standalone=\"no\""); |
|
break; |
|
case 1: |
|
xmlBufferWriteChar(" standalone=\"yes\""); |
|
break; |
|
} |
|
xmlBufferWriteChar("?>\n"); |
if (cur->dtds != NULL) |
if (cur->dtds != NULL) |
xmlDtdListDump(cur->dtds); |
xmlDtdListDump(cur->dtds); |
if (cur->root != NULL) |
if (cur->root != NULL) |
Line 735 void xmlDocDump(FILE *f, xmlDocPtr cur)
|
Line 752 void xmlDocDump(FILE *f, xmlDocPtr cur)
|
else |
else |
xmlBufferWriteChar("<?xml version=\""); |
xmlBufferWriteChar("<?xml version=\""); |
xmlBufferWriteCHAR(cur->version); |
xmlBufferWriteCHAR(cur->version); |
xmlBufferWriteChar("\"?>\n"); |
xmlBufferWriteChar("\""); |
|
if (cur->encoding != NULL) { |
|
xmlBufferWriteChar(" encoding=\""); |
|
xmlBufferWriteCHAR(cur->encoding); |
|
xmlBufferWriteChar("\""); |
|
} |
|
switch (cur->standalone) { |
|
case 0: |
|
xmlBufferWriteChar(" standalone=\"no\""); |
|
break; |
|
case 1: |
|
xmlBufferWriteChar(" standalone=\"yes\""); |
|
break; |
|
} |
|
xmlBufferWriteChar("?>\n"); |
if (cur->dtds != NULL) |
if (cur->dtds != NULL) |
xmlDtdListDump(cur->dtds); |
xmlDtdListDump(cur->dtds); |
if (cur->root != NULL) |
if (cur->root != NULL) |