--- parser3/src/classes/xdoc.C 2019/10/31 13:10:42 1.195 +++ parser3/src/classes/xdoc.C 2020/11/10 22:42:25 1.197 @@ -28,7 +28,7 @@ #include "xnode.h" #include "pa_charsets.h" -volatile const char * IDENT_XDOC_C="$Id: xdoc.C,v 1.195 2019/10/31 13:10:42 moko Exp $"; +volatile const char * IDENT_XDOC_C="$Id: xdoc.C,v 1.197 2020/11/10 22:42:25 moko Exp $"; // defines @@ -168,9 +168,8 @@ struct IdsIteratorInfo { xmlNode *element; }; -/* Hash Scanner function for pa_getElementById */ -extern "C" void // switching to calling convetion of libxml -idsHashScanner (void *payload, void *data, xmlChar *name) { +/* switching to calling convetion of libxml */ +extern "C" void idsHashScanner (void *payload, void *data, const xmlChar *name) { IdsIteratorInfo *priv = (IdsIteratorInfo *)data; if (priv->element == NULL && xmlStrEqual (name, priv->elementId)) @@ -181,11 +180,10 @@ idsHashScanner (void *payload, void *dat } } -static xmlNode* -pa_getElementById(xmlDoc& xmldoc, xmlChar* elementId) { +static xmlNode* pa_getElementById(xmlDoc& xmldoc, xmlChar* elementId) { xmlHashTable *ids = (xmlHashTable *)xmldoc.ids; IdsIteratorInfo iter={elementId, NULL}; - xmlHashScan(ids, idsHashScanner, &iter); + xmlHashScan(ids, (xmlHashScanner)idsHashScanner, &iter); return iter.element; } @@ -417,7 +415,7 @@ static void _create(Request& r, MethodPa const char* URI_cstr; if(params.count()>1) { // absolute(param) const String& URI=params.as_string(0, "URI must be string"); - URI_cstr=r.absolute(URI).cstr(); + URI_cstr=r.full_disk_path(URI).cstr(); } else // default = disk path to requested document URI_cstr=r.request_info.path_translated; if(URI_cstr) @@ -436,7 +434,7 @@ static void _load(Request& r, MethodPara const String* uri=¶ms.as_string(0, "URI must be string"); const char* uri_cstr; if(uri->pos("://")==STRING_NOT_FOUND) // disk path - uri_cstr=r.absolute(*uri).taint_cstr(String::L_FILE_SPEC); + uri_cstr=r.full_disk_path(*uri).taint_cstr(String::L_FILE_SPEC); else // xxx:// uri_cstr=uri->taint_cstr(String::L_AS_IS); // leave as-is for xmlParseFile to handle @@ -560,7 +558,7 @@ static void _file(Request& r, MethodPara static void _save(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); - const String& file_spec=r.absolute(params.as_string(0, FILE_NAME_MUST_BE_STRING)); + const String& file_spec=r.full_disk_path(params.as_string(0, FILE_NAME_MUST_BE_STRING)); XDocOutputOptions oo(vdoc.output_options); oo.append(r, get_options(params, 1)); @@ -687,8 +685,7 @@ static void _transform(Request& r, Metho result=&_transform(r, 0, vdoc, vstylesheet.stylesheet, transform_params); } else { // stylesheet (file name) // extablish stylesheet connection - const String& stylesheet_filespec= - r.absolute(params.as_string(0, "stylesheet must be file name (string) or DOM document (xdoc)")); + const String& stylesheet_filespec=r.full_disk_path(params.as_string(0, "stylesheet must be file name (string) or DOM document (xdoc)")); Stylesheet_connection_ptr connection=stylesheet_manager->get_connection(stylesheet_filespec); // load and compile file to stylesheet [or get cached if any]