version 1.16, 1997/02/03 13:52:23
|
version 1.17, 1997/02/04 12:13:42
|
Line 417 char *docName;
|
Line 417 char *docName;
|
if (ptr) |
if (ptr) |
*ptr = EOS; |
*ptr = EOS; |
|
|
if (IsW3Path (tempname) || doc == 0) |
if (IsW3Path (tempname)) |
/* the name is complete */ |
/* the name is complete */ |
strcpy (newName, tempname); |
strcpy (newName, tempname); |
else |
else |
{ |
{ |
/* take into account the BASE element. */ |
if (doc == 0) |
length = MAX_LENGTH; |
|
/* get the root element */ |
|
el = TtaGetMainRoot (doc); |
|
|
|
/* search the BASE element */ |
|
elType.ElSSchema = TtaGetDocumentSSchema (doc); |
|
elType.ElTypeNum = HTML_EL_BASE; |
|
el = TtaSearchTypedElement (elType, SearchInTree, el); |
|
if (el) |
|
{ |
{ |
/* |
basename_ptr = ""; |
** The document has a BASE element |
basename_flag = FALSE; |
** Get the HREF attribute of the BASE Element |
} |
*/ |
else |
attrType.AttrSSchema = elType.ElSSchema; |
{ |
attrType.AttrTypeNum = HTML_ATTR_HREF_; |
/* take into account the BASE element. */ |
attrHREF = TtaGetAttribute (el, attrType); |
length = MAX_LENGTH; |
if (attrHREF) |
/* get the root element */ |
|
el = TtaGetMainRoot (doc); |
|
|
|
/* search the BASE element */ |
|
elType.ElSSchema = TtaGetDocumentSSchema (doc); |
|
elType.ElTypeNum = HTML_EL_BASE; |
|
el = TtaSearchTypedElement (elType, SearchInTree, el); |
|
if (el) |
{ |
{ |
/* Use the base path of the document */ |
/* |
TtaGiveTextAttributeValue (attrHREF, basename, &length); |
** The document has a BASE element |
/* base and orgName have to be separated by a DIR_SEP */ |
** Get the HREF attribute of the BASE Element |
if (basename[strlen (basename) - 1] != DIR_SEP) |
*/ |
|
attrType.AttrSSchema = elType.ElSSchema; |
|
attrType.AttrTypeNum = HTML_ATTR_HREF_; |
|
attrHREF = TtaGetAttribute (el, attrType); |
|
if (attrHREF) |
{ |
{ |
if (IsHTMLName (basename)) |
/* Use the base path of the document */ |
|
TtaGiveTextAttributeValue (attrHREF, basename, &length); |
|
/* base and orgName have to be separated by a DIR_SEP */ |
|
if (basename[strlen (basename) - 1] != DIR_SEP) |
{ |
{ |
/* remove the document name from basename */ |
if (IsHTMLName (basename)) |
length = strlen (basename) - 1; |
{ |
while (basename[length] != DIR_SEP) |
/* remove the document name from basename */ |
basename[length--] = EOS; |
length = strlen (basename) - 1; |
|
while (basename[length] != DIR_SEP) |
|
basename[length--] = EOS; |
|
} |
|
else if (tempname[0] != DIR_SEP) |
|
strcat (basename, DIR_STR); |
} |
} |
else if (tempname[0] != DIR_SEP) |
|
strcat (basename, DIR_STR); |
|
} |
} |
|
else |
|
basename[0] = EOS; |
} |
} |
else |
else |
basename[0] = EOS; |
basename[0] = EOS; |
} |
|
else |
|
basename[0] = EOS; |
|
|
|
if (basename[0] == EOS) |
if (basename[0] == EOS) |
{ |
|
/* there is no BASE element in that document. */ |
|
if (DocumentURLs[(int) doc]) |
|
{ |
{ |
basename_ptr = HTParse (DocumentURLs[(int) doc], "", PARSE_ALL); |
/* there is no BASE element in that document. */ |
basename_flag = TRUE; |
if (DocumentURLs[(int) doc]) |
|
{ |
|
basename_ptr = HTParse (DocumentURLs[(int) doc], "", PARSE_ALL); |
|
basename_flag = TRUE; |
|
} |
|
else |
|
{ |
|
basename_ptr = ""; |
|
basename_flag = FALSE; |
|
} |
} |
} |
else |
else |
{ |
{ |
basename_ptr = ""; |
basename_ptr = HTParse (basename, "", PARSE_ALL); |
basename_flag = FALSE; |
basename_flag = TRUE; |
} |
} |
} |
} |
else |
|
{ |
|
basename_ptr = HTParse (basename, "", PARSE_ALL); |
|
basename_flag = TRUE; |
|
} |
|
|
|
if (tempname[0] == '/') |
if (tempname[0] == '/' && doc) |
ptr = HTParse (tempname, basename_ptr, PARSE_ACCESS | PARSE_PUNCTUATION | PARSE_HOST); |
ptr = HTParse (tempname, basename_ptr, PARSE_ACCESS | PARSE_PUNCTUATION | PARSE_HOST); |
else |
else |
ptr = HTParse (tempname, basename_ptr, PARSE_ALL); |
ptr = HTParse (tempname, basename_ptr, PARSE_ALL); |