Re: [xml] sgi regression failure




So this is broken on machines without the file /etc/xml/catalog

The new catalog is added fine in the default catalog, its child gets set
correctly, but the catalog->type gets set to XML_CATA_BROKEN_CATALOG
because the default catalog file doesnt exist.

Later when we try to look up the ID, we skip it because of its type.

starting at line:2042 in catalog.c
    while (catal != NULL) {
        if (catal->type == XML_CATA_CATALOG) {
            if (catal->children == NULL) {
                xmlFetchXMLCatalogFile(catal);
            }
            if (catal->children != NULL) {
                ret = xmlCatalogXMLResolve(catal->children, pubID, sysID);
                if (ret != NULL) {
                    if (normid != NULL)
                        xmlFree(normid);
                    return(ret);
                }
            }
        }
        catal = catal->next;
    }

So if I add:

    if (doregister) {
        catal->type = XML_CATA_CATALOG; //<<<--- newly added line
        cur = xmlHashLookup(xmlCatalogXMLFiles, catal->URL);
        if (cur != NULL)
            cur->children = catal->children;
    }

at line: 1549 of catalog.c it works.

I just don't know if this is too heavy handed, or if there is some other
way to set the default catalog. Any thoughts?

--mc


On Fri, 2006-02-24 at 10:20 -0500, Daniel Veillard wrote:
On Fri, Feb 24, 2006 at 07:55:23AM -0700, Martin Cole wrote:
I am attaching the code for a standalone.  As I mentioned in the
original mail, yes this code works, it has been tested on linux and mac
as well. I guess I should have just given you the code to start with. I

  Oh sorry, I missed that.

Then the simplest way is to run the code in a debugger in parallel on
both machines and see where the behaviour start to diverge. Of course
make sure that both are updated to the latest released version.
You can also export the catalog debug environment variable and see how
both diverge:
  http://xmlsoft.org/catalog.html#validate
This code really isn't platform specific in any way, so I have no
idea why it would fail to work on a given OS, and without being able
to debug a live session I doubt it's gonna be easy.

Daniel
  





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