version 1.2, 1999/01/31 20:56:35
|
version 1.3, 1999/02/01 10:30:21
|
Line 78 xmlCopyElementContent(xmlElementContentP
|
Line 78 xmlCopyElementContent(xmlElementContentP
|
} |
} |
|
|
/** |
/** |
* xmlNewElementContent: |
* xmlFreeElementContent: |
* @name: the subelement name or NULL |
* @cur: the element content tree to free |
* @type: the type of element content decl |
|
* |
* |
* Free an element content structure. This is a recursive call ! |
* Free an element content structure. This is a recursive call ! |
*/ |
*/ |
Line 89 xmlFreeElementContent(xmlElementContentP
|
Line 88 xmlFreeElementContent(xmlElementContentP
|
/* TODO !!! */ |
/* TODO !!! */ |
} |
} |
|
|
|
/** |
|
* xmlDumpElementContent: |
|
* @content: An element table |
|
* @glob: 1 if one must print the englobing parenthesis, 0 otherwise |
|
* |
|
* This will dump the content of the element table as an XML DTD definition |
|
* |
|
* NOTE: TODO an extra parameter allowing a reentant implementation will |
|
* be added. |
|
*/ |
|
void |
|
xmlDumpElementContent(xmlElementContentPtr content, int glob) { |
|
if (content == NULL) return; |
|
|
|
if (glob) xmlBufferWriteChar("("); |
|
switch (content->type) { |
|
case XML_ELEMENT_CONTENT_PCDATA: |
|
xmlBufferWriteChar("#PCDATA"); |
|
break; |
|
case XML_ELEMENT_CONTENT_ELEMENT: |
|
xmlBufferWriteCHAR(content->name); |
|
break; |
|
case XML_ELEMENT_CONTENT_SEQ: |
|
if ((content->c1->type == XML_ELEMENT_CONTENT_OR) || |
|
(content->c1->type == XML_ELEMENT_CONTENT_SEQ)) |
|
xmlDumpElementContent(content->c1, 1); |
|
else |
|
xmlDumpElementContent(content->c1, 0); |
|
xmlBufferWriteChar(" , "); |
|
if (content->c2->type == XML_ELEMENT_CONTENT_OR) |
|
xmlDumpElementContent(content->c2, 1); |
|
else |
|
xmlDumpElementContent(content->c2, 0); |
|
break; |
|
case XML_ELEMENT_CONTENT_OR: |
|
if ((content->c1->type == XML_ELEMENT_CONTENT_OR) || |
|
(content->c1->type == XML_ELEMENT_CONTENT_SEQ)) |
|
xmlDumpElementContent(content->c1, 1); |
|
else |
|
xmlDumpElementContent(content->c1, 0); |
|
xmlBufferWriteChar(" | "); |
|
if (content->c2->type == XML_ELEMENT_CONTENT_SEQ) |
|
xmlDumpElementContent(content->c2, 1); |
|
else |
|
xmlDumpElementContent(content->c2, 0); |
|
break; |
|
default: |
|
fprintf(stderr, "xmlDumpElementContent: unknown type %d\n", |
|
content->type); |
|
} |
|
if (glob) |
|
xmlBufferWriteChar(")"); |
|
switch (content->ocur) { |
|
case XML_ELEMENT_CONTENT_ONCE: |
|
break; |
|
case XML_ELEMENT_CONTENT_OPT: |
|
xmlBufferWriteChar("?"); |
|
break; |
|
case XML_ELEMENT_CONTENT_MULT: |
|
xmlBufferWriteChar("*"); |
|
break; |
|
case XML_ELEMENT_CONTENT_PLUS: |
|
xmlBufferWriteChar("+"); |
|
break; |
|
} |
|
} |
|
|
/**************************************************************** |
/**************************************************************** |
* * |
* * |
* Registration of DTD declarations * |
* Registration of DTD declarations * |
Line 337 xmlDumpElementTable(xmlElementTablePtr t
|
Line 403 xmlDumpElementTable(xmlElementTablePtr t
|
case XML_ELEMENT_TYPE_EMPTY: |
case XML_ELEMENT_TYPE_EMPTY: |
xmlBufferWriteChar("<!ELEMENT "); |
xmlBufferWriteChar("<!ELEMENT "); |
xmlBufferWriteCHAR(cur->name); |
xmlBufferWriteCHAR(cur->name); |
xmlBufferWriteChar(" EMPTY>"); |
xmlBufferWriteChar(" EMPTY>\n"); |
break; |
break; |
case XML_ELEMENT_TYPE_ANY: |
case XML_ELEMENT_TYPE_ANY: |
xmlBufferWriteChar("<!ELEMENT "); |
xmlBufferWriteChar("<!ELEMENT "); |
xmlBufferWriteCHAR(cur->name); |
xmlBufferWriteCHAR(cur->name); |
xmlBufferWriteChar(" ANY>"); |
xmlBufferWriteChar(" ANY>\n"); |
break; |
break; |
case XML_ELEMENT_TYPE_MIXED: |
case XML_ELEMENT_TYPE_MIXED: |
/* TODO !!! */ |
xmlBufferWriteChar("<!ELEMENT "); |
|
xmlBufferWriteCHAR(cur->name); |
|
xmlBufferWriteChar(" "); |
|
xmlDumpElementContent(cur->content, 1); |
|
xmlBufferWriteChar(">\n"); |
break; |
break; |
case XML_ELEMENT_TYPE_ELEMENT: |
case XML_ELEMENT_TYPE_ELEMENT: |
/* TODO !!! */ |
xmlBufferWriteChar("<!ELEMENT "); |
|
xmlBufferWriteCHAR(cur->name); |
|
xmlBufferWriteChar(" "); |
|
xmlDumpElementContent(cur->content, 1); |
|
xmlBufferWriteChar(">\n"); |
break; |
break; |
default: |
default: |
fprintf(stderr, |
fprintf(stderr, |