Re: [xml] xmllint format and tabs



The variable xmlTreeIndentString defined in include/xmlsec/globals.h contains the string used to do one level indent. By default it is set to " " (two spaces). The patch to xmllint.c to set it from an environment variable is trivial (see
attached file).  I can commit it if Daniel has no objections.

Aleksey

Dan Allen wrote:

Is there anyway to set the spacing character used with xmllint?  I
would be interested in setting this to a tab character.  I would
imagine the best way to go about this (if not already implemented,
and I apologize for the suggestion if it is) would be to set a shell
variable similar in style to the TS variable.

Thanks! ;)

Dan


Index: xmllint.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/xmllint.c,v
retrieving revision 1.73
diff -u -r1.73 xmllint.c
--- xmllint.c   7 Mar 2003 18:32:56 -0000       1.73
+++ xmllint.c   9 Mar 2003 18:51:30 -0000
@@ -1247,7 +1247,8 @@
     int i, acount;
     int files = 0;
     int version = 0;
-
+    const char* indent;
+    
     if (argc <= 1) {
        usage(argv[0]);
        return(1);
@@ -1452,6 +1453,12 @@
        xmlRegisterNodeDefault(registerNode);
        xmlDeregisterNodeDefault(deregisterNode);
     }
+    
+    indent = getenv("XMLLINT_INDENT");
+    if(indent != NULL) {
+       xmlTreeIndentString = indent;
+    }
+    
 
     xmlLineNumbersDefault(1);
     if (loaddtd != 0)


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