version 1.157, 2009/04/07 06:39:56
|
version 1.158, 2009/09/24 15:30:41
|
Line 277 void AddRowsColumns (Element el, Documen
|
Line 277 void AddRowsColumns (Element el, Documen
|
void XhtmlElementComplete (ParserData *context, Element el, int *error) |
void XhtmlElementComplete (ParserData *context, Element el, int *error) |
{ |
{ |
Document doc; |
Document doc; |
ElementType elType, newElType, childType; |
ElementType elType, newElType, childType, parentType; |
Element child, desc, leaf, prev, next, last, |
Element child, desc, leaf, prev, next, last; |
elFrames, lastFrame, lastChild, parent, picture, content, legend; |
Element elFrames, lastFrame, lastChild, parent, picture, content, legend; |
Attribute attr; |
Attribute attr; |
AttributeType attrType; |
AttributeType attrType; |
SSchema htmlSchema; |
SSchema htmlSchema; |
Line 287 void XhtmlElementComplete (ParserData *c
|
Line 287 void XhtmlElementComplete (ParserData *c
|
char *text; |
char *text; |
char lastChar[2]; |
char lastChar[2]; |
char *name1, *data; |
char *name1, *data; |
|
char msgBuffer[MaxMsgLength]; |
int typenum, length; |
int typenum, length; |
ThotBool isImage, isInline, clean; |
ThotBool isImage, isInline, clean; |
|
|
*error = 0; |
*error = 0; |
doc = context->doc; |
doc = context->doc; |
|
|
elType = TtaGetElementType (el); |
elType = TtaGetElementType (el); |
htmlSchema = elType.ElSSchema; |
htmlSchema = elType.ElSSchema; |
childType.ElSSchema = NULL; |
childType.ElSSchema = NULL; |
isInline = IsXMLElementInline (elType, doc); |
isInline = IsXMLElementInline (elType, doc); |
newElType.ElSSchema = elType.ElSSchema; |
newElType.ElSSchema = elType.ElSSchema; |
|
if (!IsCharacterLevelType (elType)) |
|
{ |
|
// check the validity of the XHTML structure |
|
parent = TtaGetParent (el); |
|
parentType = TtaGetElementType (parent); |
|
if (parentType.ElSSchema == elType.ElSSchema && |
|
(parentType.ElTypeNum == HTML_EL_Paragraph || |
|
parentType.ElTypeNum == HTML_EL_H1 || |
|
parentType.ElTypeNum == HTML_EL_H2 || |
|
parentType.ElTypeNum == HTML_EL_H3 || |
|
parentType.ElTypeNum == HTML_EL_H4 || |
|
parentType.ElTypeNum == HTML_EL_H5 || |
|
parentType.ElTypeNum == HTML_EL_H6 || |
|
parentType.ElTypeNum == HTML_EL_Preformatted|| |
|
parentType.ElTypeNum == HTML_EL_Address)) |
|
{ |
|
name1 = TtaStrdup ( TtaGetElementTypeName(elType)); |
|
if (name1) |
|
{ |
|
sprintf (msgBuffer, "A <%s> element cannot be a child of <%s> element", |
|
name1, TtaGetElementTypeName(parentType)); |
|
XmlParseError (errorParsing, (unsigned char *)msgBuffer, |
|
TtaGetElementLineNumber(el)); |
|
TtaFreeMemory (name1); |
|
} |
|
name1 = NULL; |
|
} |
|
} |
if (elType.ElTypeNum == HTML_EL_ins || |
if (elType.ElTypeNum == HTML_EL_ins || |
elType.ElTypeNum == HTML_EL_del) |
elType.ElTypeNum == HTML_EL_del) |
{ |
{ |
Line 350 void XhtmlElementComplete (ParserData *c
|
Line 377 void XhtmlElementComplete (ParserData *c
|
if (elType.ElTypeNum != HTML_EL_Comment_ && |
if (elType.ElTypeNum != HTML_EL_Comment_ && |
elType.ElTypeNum != HTML_EL_ASP_element && |
elType.ElTypeNum != HTML_EL_ASP_element && |
elType.ElTypeNum != HTML_EL_XMLPI && |
elType.ElTypeNum != HTML_EL_XMLPI && |
elType.ElTypeNum != HTML_EL_SCRIPT_) |
elType.ElTypeNum != HTML_EL_SCRIPT_) |
BlockInCharLevelElem (el); |
BlockInCharLevelElem (el); |
|
|
typenum = elType.ElTypeNum; |
typenum = elType.ElTypeNum; |