Re: [xslt] Bug (?) in attribute set resolver?
- From: Daniel Veillard <veillard redhat com>
- To: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: Re: [xslt] Bug (?) in attribute set resolver?
- Date: Fri, 24 Oct 2008 12:09:34 +0200
On Thu, Oct 23, 2008 at 05:07:54PM -0400, Jonathan S. Shapiro wrote:
> On Thu, 2008-10-23 at 13:54 -0400, Robert Koberg wrote:
> > It sounds like you have a DTD referenced in your XHTML source and
> > there is a slow/non-existent network connection that is trying to find
> > it.
>
> Thanks. That was it.
>
> Daniel: when -v is used, would it be possible to print some form of
> diagnostic as each file fetch is attempted, and also any errors that
> result? That would have made resolution of this issue trivial. The
> current error message is pretty obfuscating...
yes that would make sense, could you try the following patch ?
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
Index: xsltproc/xsltproc.c
===================================================================
--- xsltproc/xsltproc.c (revision 1491)
+++ xsltproc/xsltproc.c (working copy)
@@ -530,7 +530,7 @@ static void usage(const char *name) {
int
main(int argc, char **argv)
{
- int i;
+ int i, verbose = 0;
xsltStylesheetPtr cur = NULL;
xmlDocPtr doc, style;
xsltSecurityPrefsPtr sec = NULL;
@@ -564,6 +564,7 @@ main(int argc, char **argv)
(!strcmp(argv[i], "-verbose")) ||
(!strcmp(argv[i], "--verbose"))) {
xsltSetGenericDebugFunc(stderr, NULL);
+ verbose = 1;
} else if ((!strcmp(argv[i], "-o")) ||
(!strcmp(argv[i], "-output")) ||
(!strcmp(argv[i], "--output"))) {
@@ -792,6 +793,8 @@ main(int argc, char **argv)
if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) {
if (timing)
startTimer();
+ if (verbose)
+ fprintf(stderr, "Parsing stylesheet %s\n", argv[i]);
style = xmlReadFile((const char *) argv[i], NULL, options);
if (timing)
endTimer("Parsing stylesheet %s", argv[i]);
@@ -814,6 +817,9 @@ main(int argc, char **argv)
cur = NULL;
errorno = 4;
} else {
+ if (verbose)
+ fprintf(stderr, "Parsing stylesheet %s finished\n",
+ argv[i]);
cur = xsltLoadStylesheetPI(style);
if (cur != NULL) {
/* it is an embedded stylesheet */
@@ -844,6 +850,8 @@ main(int argc, char **argv)
if ((cur != NULL) && (cur->errors == 0)) {
for (; i < argc; i++) {
doc = NULL;
+ if (verbose)
+ fprintf(stderr, "parsing document %s\n", argv[i]);
if (timing)
startTimer();
#ifdef LIBXML_HTML_ENABLED
@@ -857,6 +865,8 @@ main(int argc, char **argv)
errorno = 6;
continue;
}
+ if (verbose)
+ fprintf(stderr, "parsing document %s finished\n", argv[i]);
if (timing)
endTimer("Parsing document %s", argv[i]);
xsltProcess(doc, cur, argv[i]);
Index: libxslt/documents.c
===================================================================
--- libxslt/documents.c (revision 1491)
+++ libxslt/documents.c (working copy)
@@ -66,6 +66,10 @@ xsltDocDefaultLoaderFunc(const xmlChar *
xmlParserInputPtr inputStream;
xmlDocPtr doc;
+#ifdef WITH_XSLT_DEBUG
+ xsltGenericDebug(xsltGenericDebugContext,
+ "Starting to parse document %s\n", URI);
+#endif
pctxt = xmlNewParserCtxt();
if (pctxt == NULL)
return(NULL);
@@ -95,8 +99,16 @@ xsltDocDefaultLoaderFunc(const xmlChar *
if (pctxt->wellFormed) {
doc = pctxt->myDoc;
+#ifdef WITH_XSLT_DEBUG
+ xsltGenericDebug(xsltGenericDebugContext,
+ "Document %s parsed\n", URI);
+#endif
}
else {
+#ifdef WITH_XSLT_DEBUG
+ xsltGenericDebug(xsltGenericDebugContext,
+ "Document %s failed to parse\n", URI);
+#endif
doc = NULL;
xmlFreeDoc(pctxt->myDoc);
pctxt->myDoc = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]