[xml] Re: Sax and Dtd's



my path-change-function looks like this:

xmlParserInputPtr xmlMyExternalEntityLoader(const char *URL, const char
*ID,xmlParserCtxtPtr ctxt)
{
 static char DTDURL[] =  "./dtd/xyz.dtd";
    xmlParserInputPtr ret;
    const char *fileID = NULL;

    ret = xmlNewInputFromFile(ctxt, fileID);
    if (ret != NULL) {
        return(ret);
 } else if(strstr(URL,"xyz.dtd")) {

    if (defaultLoader != NULL) ret = defaultLoader(DTDURL, ID, ctxt);
 } else if (defaultLoader != NULL) ret = defaultLoader(URL, ID, ctxt);

    return(ret);
}


ok it works with the dom parser, but if i use it with the xmltextreader i
get:

./dtd/xyz.dtd:3: I/O error : failed to load external entity "(null)"
...


?! so what's the difference?!

Thanx






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]