Commit be480fbb authored by Daniel Veillard's avatar Daniel Veillard
Browse files

trying to fix namespaces + validation problems for good, closing #63619 in

* valid.c include/libxml/tree.h: trying to fix namespaces +
  validation problems for good, closing #63619 in the process
* result/valid/dia.xml test/valid/dia.xml: the Dia test was
  wrong in this respect, fixed it.
Daniel
parent d536f701
Fri Nov 9 00:34:13 CET 2001 Daniel Veillard <daniel@veillard.com>
* valid.c include/libxml/tree.h: trying to fix namespaces +
validation problems for good, closing #63619 in the process
* result/valid/dia.xml test/valid/dia.xml: the Dia test was
wrong in this respect, fixed it.
Thu Nov 8 18:31:40 CET 2001 Daniel Veillard <daniel@veillard.com>
* xmllint.c: Morus Walter patch to allow --format and --encode
......
......@@ -228,10 +228,11 @@ typedef xmlElementContent *xmlElementContentPtr;
struct _xmlElementContent {
xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
const xmlChar *name; /* Element name */
const xmlChar *name; /* Element name */
struct _xmlElementContent *c1; /* first child */
struct _xmlElementContent *c2; /* second child */
struct _xmlElementContent *parent; /* parent */
const xmlChar *prefix; /* Element name */
};
/**
......
<?xml version="1.0"?>
<!DOCTYPE diagram [
<!ELEMENT diagram (diagramdata , layer*)>
<!ELEMENT diagramdata (attribute)*>
<!ELEMENT layer (object | group)*>
<!ATTLIST layer name CDATA #REQUIRED>
<!ATTLIST layer visible (true | false) #REQUIRED>
<!ELEMENT object (attribute* , connections?)>
<!ATTLIST object type CDATA #REQUIRED>
<!ATTLIST object version NMTOKEN #REQUIRED>
<!ATTLIST object id ID #REQUIRED>
<!ELEMENT connections (connection)*>
<!ELEMENT connection EMPTY>
<!ATTLIST connection handle NMTOKEN #REQUIRED>
<!ATTLIST connection to IDREF #REQUIRED>
<!ATTLIST connection connection NMTOKEN #REQUIRED>
<!ELEMENT group (object | group)*>
<!ELEMENT attribute (composite | int | enum | real | boolean | color | point | rectangle | string | font)*>
<!ATTLIST attribute name CDATA #REQUIRED>
<!ELEMENT composite (attribute)*>
<!ATTLIST composite type CDATA #IMPLIED>
<!ELEMENT int EMPTY>
<!ATTLIST int val NMTOKEN #REQUIRED>
<!ELEMENT enum EMPTY>
<!ATTLIST enum val NMTOKEN #REQUIRED>
<!ELEMENT real EMPTY>
<!ATTLIST real val CDATA #REQUIRED>
<!ELEMENT boolean EMPTY>
<!ATTLIST boolean val (true | false) #REQUIRED>
<!ELEMENT color EMPTY>
<!ATTLIST color val CDATA #REQUIRED>
<!ELEMENT point EMPTY>
<!ATTLIST point val CDATA #REQUIRED>
<!ELEMENT rectangle EMPTY>
<!ATTLIST rectangle val CDATA #REQUIRED>
<!ELEMENT string EMPTY>
<!ATTLIST string val CDATA #IMPLIED>
<!ELEMENT font EMPTY>
<!ATTLIST font name CDATA #REQUIRED>
<!DOCTYPE dia:diagram [
<!ELEMENT dia:diagram (dia:diagramdata , dia:layer*)>
<!ELEMENT dia:diagramdata (dia:attribute)*>
<!ELEMENT dia:layer (dia:object | dia:group)*>
<!ATTLIST dia:layer dia:name CDATA #REQUIRED>
<!ATTLIST dia:layer dia:visible (true | false) #REQUIRED>
<!ELEMENT dia:object (dia:attribute* , dia:connections?)>
<!ATTLIST dia:object dia:type CDATA #REQUIRED>
<!ATTLIST dia:object dia:version NMTOKEN #REQUIRED>
<!ATTLIST dia:object dia:id ID #REQUIRED>
<!ELEMENT dia:connections (dia:connection)*>
<!ELEMENT dia:connection EMPTY>
<!ATTLIST dia:connection dia:handle NMTOKEN #REQUIRED>
<!ATTLIST dia:connection dia:to IDREF #REQUIRED>
<!ATTLIST dia:connection dia:connection NMTOKEN #REQUIRED>
<!ELEMENT dia:group (dia:object | dia:group)*>
<!ELEMENT dia:attribute (dia:composite | dia:int | dia:enum | dia:real | dia:boolean | dia:color | dia:point | dia:rectangle | dia:string | dia:font)*>
<!ATTLIST dia:attribute dia:name CDATA #REQUIRED>
<!ELEMENT dia:composite (dia:attribute)*>
<!ATTLIST dia:composite dia:type CDATA #IMPLIED>
<!ELEMENT dia:int EMPTY>
<!ATTLIST dia:int dia:val NMTOKEN #REQUIRED>
<!ELEMENT dia:enum EMPTY>
<!ATTLIST dia:enum dia:val NMTOKEN #REQUIRED>
<!ELEMENT dia:real EMPTY>
<!ATTLIST dia:real dia:val CDATA #REQUIRED>
<!ELEMENT dia:boolean EMPTY>
<!ATTLIST dia:boolean dia:val (true | false) #REQUIRED>
<!ELEMENT dia:color EMPTY>
<!ATTLIST dia:color dia:val CDATA #REQUIRED>
<!ELEMENT dia:point EMPTY>
<!ATTLIST dia:point dia:val CDATA #REQUIRED>
<!ELEMENT dia:rectangle EMPTY>
<!ATTLIST dia:rectangle dia:val CDATA #REQUIRED>
<!ELEMENT dia:string EMPTY>
<!ATTLIST dia:string dia:val CDATA #IMPLIED>
<!ELEMENT dia:font EMPTY>
<!ATTLIST dia:font dia:name CDATA #REQUIRED>
]>
<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
<dia:diagramdata>
<dia:attribute name="background">
<dia:color val="#ffffff"/>
<dia:attribute dia:name="background">
<dia:color dia:val="#ffffff"/>
</dia:attribute>
</dia:diagramdata>
<dia:layer name="Background" visible="true">
<dia:object type="Standard - Line" version="0" id="O0">
<dia:attribute name="obj_pos">
<dia:point val="1.95,6.85"/>
<dia:layer dia:name="Background" dia:visible="true">
<dia:object dia:type="Standard - Line" dia:version="0" dia:id="O0">
<dia:attribute dia:name="obj_pos">
<dia:point dia:val="1.95,6.85"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="1.9,6.8;11,8.55"/>
<dia:attribute dia:name="obj_bb">
<dia:rectangle dia:val="1.9,6.8;11,8.55"/>
</dia:attribute>
<dia:attribute name="conn_endpoints">
<dia:point val="1.95,6.85"/>
<dia:point val="10.95,8.5"/>
<dia:attribute dia:name="conn_endpoints">
<dia:point dia:val="1.95,6.85"/>
<dia:point dia:val="10.95,8.5"/>
</dia:attribute>
<dia:attribute name="line_color">
<dia:color val="#000000"/>
<dia:attribute dia:name="line_color">
<dia:color dia:val="#000000"/>
</dia:attribute>
<dia:attribute name="line_width">
<dia:real val="0.1"/>
<dia:attribute dia:name="line_width">
<dia:real dia:val="0.1"/>
</dia:attribute>
<dia:attribute name="line_style">
<dia:enum val="0"/>
<dia:attribute dia:name="line_style">
<dia:enum dia:val="0"/>
</dia:attribute>
<dia:attribute name="start_arrow">
<dia:enum val="0"/>
<dia:attribute dia:name="start_arrow">
<dia:enum dia:val="0"/>
</dia:attribute>
<dia:attribute name="end_arrow">
<dia:enum val="0"/>
<dia:attribute dia:name="end_arrow">
<dia:enum dia:val="0"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="1" to="O2" connection="3"/>
<dia:connection dia:handle="1" dia:to="O2" dia:connection="3"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="0" id="O1">
<dia:attribute name="obj_pos">
<dia:point val="4.8,4.75"/>
<dia:object dia:type="Standard - Text" dia:version="0" dia:id="O1">
<dia:attribute dia:name="obj_pos">
<dia:point dia:val="4.8,4.75"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
<dia:attribute dia:name="obj_bb">
<dia:rectangle dia:val="2.579,3.96359;7.021,4.96359"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
<dia:string val="sdfsdfg"/>
<dia:attribute dia:name="text">
<dia:composite dia:type="text">
<dia:attribute dia:name="string">
<dia:string dia:val="sdfsdfg"/>
</dia:attribute>
<dia:attribute name="font">
<dia:font name="Courier"/>
<dia:attribute dia:name="font">
<dia:font dia:name="Courier"/>
</dia:attribute>
<dia:attribute name="height">
<dia:real val="1"/>
<dia:attribute dia:name="height">
<dia:real dia:val="1"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="4.8,4.75"/>
<dia:attribute dia:name="pos">
<dia:point dia:val="4.8,4.75"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
<dia:attribute dia:name="color">
<dia:color dia:val="#000000"/>
</dia:attribute>
<dia:attribute name="alignment">
<dia:enum val="1"/>
<dia:attribute dia:name="alignment">
<dia:enum dia:val="1"/>
</dia:attribute>
</dia:composite>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Box" version="0" id="O2">
<dia:attribute name="obj_pos">
<dia:point val="10.95,7.5"/>
<dia:object dia:type="Standard - Box" dia:version="0" dia:id="O2">
<dia:attribute dia:name="obj_pos">
<dia:point dia:val="10.95,7.5"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="10.9,7.45;13.05,9.55"/>
<dia:attribute dia:name="obj_bb">
<dia:rectangle dia:val="10.9,7.45;13.05,9.55"/>
</dia:attribute>
<dia:attribute name="elem_corner">
<dia:point val="10.95,7.5"/>
<dia:attribute dia:name="elem_corner">
<dia:point dia:val="10.95,7.5"/>
</dia:attribute>
<dia:attribute name="elem_width">
<dia:real val="2.05"/>
<dia:attribute dia:name="elem_width">
<dia:real dia:val="2.05"/>
</dia:attribute>
<dia:attribute name="elem_height">
<dia:real val="2"/>
<dia:attribute dia:name="elem_height">
<dia:real dia:val="2"/>
</dia:attribute>
<dia:attribute name="border_width">
<dia:real val="0.1"/>
<dia:attribute dia:name="border_width">
<dia:real dia:val="0.1"/>
</dia:attribute>
<dia:attribute name="border_color">
<dia:color val="#000000"/>
<dia:attribute dia:name="border_color">
<dia:color dia:val="#000000"/>
</dia:attribute>
<dia:attribute name="inner_color">
<dia:color val="#ffffff"/>
<dia:attribute dia:name="inner_color">
<dia:color dia:val="#ffffff"/>
</dia:attribute>
<dia:attribute name="line_style">
<dia:enum val="0"/>
<dia:attribute dia:name="line_style">
<dia:enum dia:val="0"/>
</dia:attribute>
</dia:object>
</dia:layer>
......
<?xml version="1.0"?>
<!DOCTYPE diagram [
<!ELEMENT diagram (diagramdata, (layer)*) >
<!DOCTYPE dia:diagram [
<!ELEMENT dia:diagram (dia:diagramdata, (dia:layer)*) >
<!ELEMENT diagramdata (attribute)* >
<!ELEMENT dia:diagramdata (dia:attribute)* >
<!ELEMENT layer (object | group)*>
<!ATTLIST layer
name CDATA #REQUIRED
visible (true|false) #REQUIRED >
<!ELEMENT dia:layer (dia:object | dia:group)*>
<!ATTLIST dia:layer
dia:name CDATA #REQUIRED
dia:visible (true|false) #REQUIRED >
<!ELEMENT object ((attribute)*, connections?)>
<!ATTLIST object
type CDATA #REQUIRED
version NMTOKEN #REQUIRED
id ID #REQUIRED >
<!ELEMENT dia:object ((dia:attribute)*, dia:connections?)>
<!ATTLIST dia:object
dia:type CDATA #REQUIRED
dia:version NMTOKEN #REQUIRED
dia:id ID #REQUIRED >
<!ELEMENT connections (connection)*>
<!ELEMENT dia:connections (dia:connection)*>
<!ELEMENT connection EMPTY>
<!ATTLIST connection
handle NMTOKEN #REQUIRED
to IDREF #REQUIRED
connection NMTOKEN #REQUIRED>
<!ELEMENT dia:connection EMPTY>
<!ATTLIST dia:connection
dia:handle NMTOKEN #REQUIRED
dia:to IDREF #REQUIRED
dia:connection NMTOKEN #REQUIRED>
<!ELEMENT group (object | group)*>
<!ELEMENT dia:group (dia:object | dia:group)*>
<!ELEMENT attribute (composite | int | enum | real | boolean |
color | point | rectangle | string | font)*>
<!ATTLIST attribute name CDATA #REQUIRED >
<!ELEMENT dia:attribute (dia:composite | dia:int | dia:enum | dia:real | dia:boolean |
dia:color | dia:point | dia:rectangle | dia:string | dia:font)*>
<!ATTLIST dia:attribute dia:name CDATA #REQUIRED >
<!ELEMENT composite (attribute)*>
<!ATTLIST composite type CDATA #IMPLIED>
<!ELEMENT dia:composite (dia:attribute)*>
<!ATTLIST dia:composite dia:type CDATA #IMPLIED>
<!ELEMENT int EMPTY>
<!ATTLIST int val NMTOKEN #REQUIRED>
<!ELEMENT dia:int EMPTY>
<!ATTLIST dia:int dia:val NMTOKEN #REQUIRED>
<!ELEMENT enum EMPTY>
<!ATTLIST enum val NMTOKEN #REQUIRED>
<!ELEMENT dia:enum EMPTY>
<!ATTLIST dia:enum dia:val NMTOKEN #REQUIRED>
<!ELEMENT real EMPTY>
<!ATTLIST real val CDATA #REQUIRED>
<!ELEMENT dia:real EMPTY>
<!ATTLIST dia:real dia:val CDATA #REQUIRED>
<!ELEMENT boolean EMPTY>
<!ATTLIST boolean val (true|false) #REQUIRED>
<!ELEMENT dia:boolean EMPTY>
<!ATTLIST dia:boolean dia:val (true|false) #REQUIRED>
<!ELEMENT color EMPTY>
<!ATTLIST color val CDATA #REQUIRED>
<!ELEMENT dia:color EMPTY>
<!ATTLIST dia:color dia:val CDATA #REQUIRED>
<!ELEMENT point EMPTY>
<!ATTLIST point val CDATA #REQUIRED>
<!ELEMENT dia:point EMPTY>
<!ATTLIST dia:point dia:val CDATA #REQUIRED>
<!ELEMENT rectangle EMPTY>
<!ATTLIST rectangle val CDATA #REQUIRED>
<!ELEMENT dia:rectangle EMPTY>
<!ATTLIST dia:rectangle dia:val CDATA #REQUIRED>
<!ELEMENT string EMPTY>
<!ATTLIST string val CDATA #IMPLIED>
<!ELEMENT dia:string EMPTY>
<!ATTLIST dia:string dia:val CDATA #IMPLIED>
<!ELEMENT font EMPTY>
<!ATTLIST font name CDATA #REQUIRED>
<!ELEMENT dia:font EMPTY>
<!ATTLIST dia:font dia:name CDATA #REQUIRED>
]>
<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
<dia:diagramdata>
<dia:attribute name="background">
<dia:color val="#ffffff"/>
<dia:attribute dia:name="background">
<dia:color dia:val="#ffffff"/>
</dia:attribute>
</dia:diagramdata>
<dia:layer name="Background" visible="true">
<dia:object type="Standard - Line" version="0" id="O0">
<dia:attribute name="obj_pos">
<dia:point val="1.95,6.85"/>
<dia:layer dia:name="Background" dia:visible="true">
<dia:object dia:type="Standard - Line" dia:version="0" dia:id="O0">
<dia:attribute dia:name="obj_pos">
<dia:point dia:val="1.95,6.85"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="1.9,6.8;11,8.55"/>
<dia:attribute dia:name="obj_bb">
<dia:rectangle dia:val="1.9,6.8;11,8.55"/>
</dia:attribute>
<dia:attribute name="conn_endpoints">
<dia:point val="1.95,6.85"/>
<dia:point val="10.95,8.5"/>
<dia:attribute dia:name="conn_endpoints">
<dia:point dia:val="1.95,6.85"/>
<dia:point dia:val="10.95,8.5"/>
</dia:attribute>
<dia:attribute name="line_color">
<dia:color val="#000000"/>
<dia:attribute dia:name="line_color">
<dia:color dia:val="#000000"/>
</dia:attribute>
<dia:attribute name="line_width">
<dia:real val="0.1"/>
<dia:attribute dia:name="line_width">
<dia:real dia:val="0.1"/>
</dia:attribute>
<dia:attribute name="line_style">
<dia:enum val="0"/>
<dia:attribute dia:name="line_style">
<dia:enum dia:val="0"/>
</dia:attribute>
<dia:attribute name="start_arrow">
<dia:enum val="0"/>
<dia:attribute dia:name="start_arrow">
<dia:enum dia:val="0"/>
</dia:attribute>
<dia:attribute name="end_arrow">
<dia:enum val="0"/>
<dia:attribute dia:name="end_arrow">
<dia:enum dia:val="0"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="1" to="O2" connection="3"/>
<dia:connection dia:handle="1" dia:to="O2" dia:connection="3"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="0" id="O1">
<dia:attribute name="obj_pos">
<dia:point val="4.8,4.75"/>
<dia:object dia:type="Standard - Text" dia:version="0" dia:id="O1">
<dia:attribute dia:name="obj_pos">
<dia:point dia:val="4.8,4.75"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
<dia:attribute dia:name="obj_bb">
<dia:rectangle dia:val="2.579,3.96359;7.021,4.96359"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
<dia:string val="sdfsdfg"/>
<dia:attribute dia:name="text">
<dia:composite dia:type="text">
<dia:attribute dia:name="string">
<dia:string dia:val="sdfsdfg"/>
</dia:attribute>
<dia:attribute name="font">
<dia:font name="Courier"/>
<dia:attribute dia:name="font">
<dia:font dia:name="Courier"/>
</dia:attribute>
<dia:attribute name="height">
<dia:real val="1"/>
<dia:attribute dia:name="height">
<dia:real dia:val="1"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="4.8,4.75"/>
<dia:attribute dia:name="pos">
<dia:point dia:val="4.8,4.75"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
<dia:attribute dia:name="color">
<dia:color dia:val="#000000"/>
</dia:attribute>
<dia:attribute name="alignment">
<dia:enum val="1"/>
<dia:attribute dia:name="alignment">
<dia:enum dia:val="1"/>
</dia:attribute>
</dia:composite>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Box" version="0" id="O2">
<dia:attribute name="obj_pos">
<dia:point val="10.95,7.5"/>
<dia:object dia:type="Standard - Box" dia:version="0" dia:id="O2">
<dia:attribute dia:name="obj_pos">
<dia:point dia:val="10.95,7.5"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="10.9,7.45;13.05,9.55"/>
<dia:attribute dia:name="obj_bb">
<dia:rectangle dia:val="10.9,7.45;13.05,9.55"/>
</dia:attribute>
<dia:attribute name="elem_corner">
<dia:point val="10.95,7.5"/>
<dia:attribute dia:name="elem_corner">
<dia:point dia:val="10.95,7.5"/>
</dia:attribute>
<dia:attribute name="elem_width">
<dia:real val="2.05"/>
<dia:attribute dia:name="elem_width">
<dia:real dia:val="2.05"/>
</dia:attribute>
<dia:attribute name="elem_height">
<dia:real val="2"/>
<dia:attribute dia:name="elem_height">
<dia:real dia:val="2"/>
</dia:attribute>
<dia:attribute name="border_width">
<dia:real val="0.1"/>
<dia:attribute dia:name="border_width">
<dia:real dia:val="0.1"/>
</dia:attribute>
<dia:attribute name="border_color">
<dia:color val="#000000"/>
<dia:attribute dia:name="border_color">
<dia:color dia:val="#000000"/>
</dia:attribute>
<dia:attribute name="inner_color">
<dia:color val="#ffffff"/>
<dia:attribute dia:name="inner_color">
<dia:color dia:val="#ffffff"/>
</dia:attribute>
<dia:attribute name="line_style">
<dia:enum val="0"/>
<dia:attribute dia:name="line_style">
<dia:enum dia:val="0"/>
</dia:attribute>
</dia:object>
</dia:layer>
......
......@@ -424,10 +424,16 @@ xmlNewElementContent(xmlChar *name, xmlElementContentType type) {
}
ret->type = type;
ret->ocur = XML_ELEMENT_CONTENT_ONCE;
if (name != NULL)
ret->name = xmlStrdup(name);
else
if (name != NULL) {
xmlChar *prefix = NULL;
ret->name = xmlSplitQName2(name, &prefix);
if (ret->name == NULL)
ret->name = xmlStrdup(name);
ret->prefix = prefix;
} else {
ret->name = NULL;
ret->prefix = NULL;
}
ret->c1 = ret->c2 = ret->parent = NULL;
return(ret);
}
......@@ -451,6 +457,8 @@ xmlCopyElementContent(xmlElementContentPtr cur) {
"xmlCopyElementContent : out of memory\n");
return(NULL);
}
if (cur->prefix != NULL)
ret->prefix = xmlStrdup(cur->prefix);
ret->ocur = cur->ocur;
if (cur->c1 != NULL) ret->c1 = xmlCopyElementContent(cur->c1);
if (ret->c1 != NULL)
......@@ -484,6 +492,7 @@ xmlFreeElementContent(xmlElementContentPtr cur) {
if (cur->c1 != NULL) xmlFreeElementContent(cur->c1);
if (cur->c2 != NULL) xmlFreeElementContent(cur->c2);
if (cur->name != NULL) xmlFree((xmlChar *) cur->name);
if (cur->prefix != NULL) xmlFree((xmlChar *) cur->prefix);
xmlFree(cur);
}
......@@ -505,6 +514,10 @@ xmlDumpElementContent(xmlBufferPtr buf, xmlElementContentPtr content, int glob)
xmlBufferWriteChar(buf, "#PCDATA");
break;
case XML_ELEMENT_CONTENT_ELEMENT:
if (content->prefix != NULL) {
xmlBufferWriteCHAR(buf, content->prefix);
xmlBufferWriteChar(buf, ":");
}
xmlBufferWriteCHAR(buf, content->name);
break;
case XML_ELEMENT_CONTENT_SEQ:
......@@ -594,6 +607,14 @@ xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int
strcat(buf, "#PCDATA");
break;
case XML_ELEMENT_CONTENT_ELEMENT:
if (content->prefix != NULL) {
if (size - len < xmlStrlen(content->prefix + 10)) {
strcat(buf, " ...");
return;
}
strcat(buf, (char *) content->prefix);
strcat(buf, ":");
}
if (size - len < xmlStrlen(content->name + 10)) {
strcat(buf, " ...");
return;
......@@ -936,16 +957,28 @@ xmlDumpElementDecl(xmlBufferPtr buf, xmlElementPtr elem) {
switch (elem->etype) {
case XML_ELEMENT_TYPE_EMPTY:
xmlBufferWriteChar(buf, "<!ELEMENT ");
if (elem->prefix != NULL) {
xmlBufferWriteCHAR(buf, elem->prefix);
xmlBufferWriteChar(buf, ":");
}
xmlBufferWriteCHAR(buf, elem->name);
xmlBufferWriteChar(buf, " EMPTY>\n");
break;
case XML_ELEMENT_TYPE_ANY:
xmlBufferWriteChar(buf, "<!ELEMENT ");
if (elem->prefix != NULL) {
xmlBufferWriteCHAR(buf, elem->prefix);
xmlBufferWriteChar(buf, ":");
}
xmlBufferWriteCHAR(buf, elem->name);
xmlBufferWriteChar(buf, " ANY>\n");
break;
case XML_ELEMENT_TYPE_MIXED:
xmlBufferWriteChar(buf, "<!ELEMENT ");
if (elem->prefix != NULL) {
xmlBufferWriteCHAR(buf, elem->prefix);
xmlBufferWriteChar(buf, ":");
}
xmlBufferWriteCHAR(buf, elem->name);
xmlBufferWriteChar(buf, " ");
xmlDumpElementContent(buf, elem->content, 1);
......@@ -953,6 +986,10 @@ xmlDumpElementDecl(xmlBufferPtr buf, xmlElementPtr elem) {
break;
case XML_ELEMENT_TYPE_ELEMENT:
xmlBufferWriteChar(buf, "<!ELEMENT ");
if (elem->prefix != NULL) {
xmlBufferWriteCHAR(buf, elem->prefix);
xmlBufferWriteChar(buf, ":");
}
xmlBufferWriteCHAR(buf, elem->name);
xmlBufferWriteChar(buf, " ");
xmlDumpElementContent(buf, elem->content, 1);
......@@ -3122,6 +3159,8 @@ xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
/* VC: Unique Element Type Declaration */
tst = xmlGetDtdElementDesc(doc->intSubset, elem->name);