Re: [xslt] xsltproc options



On Tue, Jan 08, 2002 at 10:49:52AM -0500, Daniel Veillard wrote:
> On Tue, Jan 08, 2002 at 03:18:28PM +0100, camille wrote:
> > [please Cc: me as i did not subscribe]
> > 
> > hi,
> > 
> > just tested xsltproc under Linux 2.4.16 glibc 2.2.4 (Mandrake Cooker).
> > It appears to work really fine, but it seems some options have no
> > effect, notably:
> 
>   When used with -o (update posted on a second post) yes there is
> no user visible difference.
> 
>   As the doc explains:
>     http://xmlsoft.org/XSLT/xsltproc2.html
> 
> 
> That should be pretty clear. If using -o the output is directed to
> a file so --repeat simply writes the file(s) 20 times and the only user
> visible option is that it should take nearly 20 times longer...

And it outputs when used with --timing that its run the transformation
20 times

> 
> 
> XPath processing requires to open the DTD associated to the document
> being transformed (if available) for example to extend the data model with
> defaulted attributes, etc... Using this option (not recommneded unless
> having a good reason) avois this phase and the XML processor does not
> load the DTD associated with the document.
> If you are doing DocBook processing or similar document handling it's
> really not a good idea to use it.
> 

Daniel - Kick me if I'm not understanding this right, but it looks as
though xsltproc is setting xmlLoadExtDtdDefaultValue *before* it reads
the command line options, so --novalid isn't having an effect. Testing
xsltproc compiled with the attached patch allowed me to invoke the
expected --novalid behavior - that is, a gob of errors when trying to
do a transformation on a DocBook document.

Cheers,
-- 
John Fleck
jfleck@inkstain.net (h), http://www.inkstain.net/fleck/
"I've noticed that most artists only repeat themselves."
 - Marcel Duchamp

Index: xsltproc.c
===================================================================
RCS file: /cvs/gnome/libxslt/xsltproc/xsltproc.c,v
retrieving revision 1.18
diff -u -r1.18 xsltproc.c
--- xsltproc.c	2002/01/04 14:51:13	1.18
+++ xsltproc.c	2002/01/08 16:07:04
@@ -306,7 +306,7 @@
     printf("\t--timing: display the time used\n");
     printf("\t--repeat: run the transformation 20 times\n");
     printf("\t--debug: dump the tree of the result instead\n");
-    printf("\t--novalid: skip the Dtd loading phase\n");
+    printf("\t--novalid skip the Dtd loading phase\n");
     printf("\t--noout: do not dump the result\n");
     printf("\t--maxdepth val : increase the maximum depth\n");
 #ifdef LIBXML_HTML_ENABLED
@@ -347,10 +347,6 @@
 
     xmlLineNumbersDefault(1);
 
-    if (novalid == 0)
-        xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
-    else
-        xmlLoadExtDtdDefaultValue = 0;
     for (i = 1; i < argc; i++) {
         if (!strcmp(argv[i], "-"))
             break;
@@ -460,6 +456,12 @@
         }
     }
     params[nbparams] = NULL;
+
+    if (novalid == 0)
+        xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
+    else
+        xmlLoadExtDtdDefaultValue = 0;
+
 
     /*
      * Replace entities with their content.


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