version 1.4, 1997/03/29 09:56:51
|
version 1.5, 1997/04/17 17:40:46
|
Line 475 boolean deleteTree;
|
Line 475 boolean deleteTree;
|
lastInserted, srce, copy, old, parent, sibling; |
lastInserted, srce, copy, old, parent, sibling; |
ElementType elType; |
ElementType elType; |
NotifyElement event; |
NotifyElement event; |
|
int checkingMode; |
|
|
firstInserted = NULL; |
firstInserted = NULL; |
/* get the BODY element of source document */ |
/* get the BODY element of source document */ |
Line 484 boolean deleteTree;
|
Line 485 boolean deleteTree;
|
body = TtaSearchTypedElement (elType, SearchForward, root); |
body = TtaSearchTypedElement (elType, SearchForward, root); |
if (body != NULL) |
if (body != NULL) |
{ |
{ |
|
/* don't check the abstract tree against the structure schema */ |
|
checkingMode = TtaGetStructureChecking (destDoc); |
|
TtaSetStructureChecking (0, destDoc); |
/* get elem, the ancestor of *el which is a child of a DIV or BODY |
/* get elem, the ancestor of *el which is a child of a DIV or BODY |
element in the destination document. The copied elements will be |
element in the destination document. The copied elements will be |
inserted just before this element. */ |
inserted just before this element. */ |
Line 552 boolean deleteTree;
|
Line 556 boolean deleteTree;
|
} |
} |
while (sibling == NULL); |
while (sibling == NULL); |
TtaDeleteTree (elem, destDoc); |
TtaDeleteTree (elem, destDoc); |
|
/* restore previous chacking mode */ |
|
TtaSetStructureChecking (checkingMode, destDoc); |
/* return the address of the first copied element */ |
/* return the address of the first copied element */ |
*el = firstInserted; |
*el = firstInserted; |
} |
} |
Line 560 boolean deleteTree;
|
Line 566 boolean deleteTree;
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
GetIncludedDocuments |
GetIncludedDocuments |
Look forward, starting from element el, for a link (A) with attribute |
Look forward, starting from element el, for a link (A) with attribute |
REL="chapter" and replace that link by the contents of the target document. |
REL="chapter" or REL="subdocument" and replace that link by the contents |
|
of the target document. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static Element GetIncludedDocuments (Element el, Document document) |
static Element GetIncludedDocuments (Element el, Document document) |
Line 581 Document document;
|
Line 588 Document document;
|
attrType.AttrTypeNum = HTML_ATTR_REL; |
attrType.AttrTypeNum = HTML_ATTR_REL; |
link = el; |
link = el; |
RelAttr = NULL; |
RelAttr = NULL; |
/* looks for an anchor having an attribute REL="chapter" */ |
/* looks for an anchor having an attribute REL="chapter" or |
|
REL="subdocument" */ |
while (link != NULL && RelAttr == NULL) |
while (link != NULL && RelAttr == NULL) |
{ |
{ |
TtaSearchAttribute (attrType, SearchForward, link, &link, &RelAttr); |
TtaSearchAttribute (attrType, SearchForward, link, &link, &RelAttr); |
Line 590 Document document;
|
Line 598 Document document;
|
length = TtaGetTextAttributeLength (RelAttr); |
length = TtaGetTextAttributeLength (RelAttr); |
text = TtaGetMemory (length + 1); |
text = TtaGetMemory (length + 1); |
TtaGiveTextAttributeValue (RelAttr, text, &length); |
TtaGiveTextAttributeValue (RelAttr, text, &length); |
if (strcasecmp (text, "chapter")) |
if (strcasecmp (text, "chapter") && strcasecmp (text, "subdocument")) |
RelAttr = NULL; |
RelAttr = NULL; |
TtaFreeMemory (text); |
TtaFreeMemory (text); |
} |
} |
Line 636 Document document;
|
Line 644 Document document;
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
MakeBook |
MakeBook |
Replace all links in a document which have an attribute REL="chapter" |
Replace all links in a document which have an attribute REL="chapter" |
by the corresponding target document. |
or REL="subdocument" by the corresponding target document. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void MakeBook (Document document, View view) |
void MakeBook (Document document, View view) |