Re: [sqlite] Shell doesn't do

2011-08-10 Thread Kit
2011/8/10 Simon Slavin :
> However, the tags the shell tool generates are upper case.  There are two 
> possible fixes:
> a) change the tool to generate lower-case tags.
> b) change the documentation to say that the tags are HTML, not XHTML.
> Simon.

OK, here is the patch.
-- 
Kit

diff --git a/src/shell.c b/src/shell.c
index a54c922..337f35a 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -746,22 +746,22 @@ static int shell_callback(void *pArg, int nArg,
char **azArg, char **azCol, int
 }
 case MODE_Html: {
   if( p->cnt++==0 && p->showHeader ){
-fprintf(p->out,"");
+fprintf(p->out,"");
 for(i=0; iout,"");
+  fprintf(p->out,"");
   output_html_string(p->out, azCol[i]);
-  fprintf(p->out,"\n");
+  fprintf(p->out,"\n");
 }
-fprintf(p->out,"\n");
+fprintf(p->out,"\n");
   }
   if( azArg==0 ) break;
-  fprintf(p->out,"");
+  fprintf(p->out,"");
   for(i=0; iout,"");
+fprintf(p->out,"");
 output_html_string(p->out, azArg[i] ? azArg[i] : p->nullvalue);
-fprintf(p->out,"\n");
+fprintf(p->out,"\n");
   }
-  fprintf(p->out,"\n");
+  fprintf(p->out,"\n");
   break;
 }
 case MODE_Tcl: {
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Simon Slavin

On 10 Aug 2011, at 6:10pm, Brian Curley wrote:

> @Simon: I'd disagree, unless you mean to make it less specific, since it's
> really an exercise for the reader to infer mark-up...not just HTML over
> XHTML.  But that's just me...

The SQLite page states specifically XHTML:



"The last output mode is "html". In this mode, sqlite3 writes the results of 
the query as an XHTML table."


All XHTML tags /must/ be lower case:



"XHTML documents must use lower case for all HTML element and attribute names."


However, the tags the shell tool generates are upper case.  There are two 
possible fixes:

a) change the tool to generate lower-case tags.
b) change the documentation to say that the tags are HTML, not XHTML.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Brian Curley
@Simon: I'd disagree, unless you mean to make it less specific, since it's
really an exercise for the reader to infer mark-up...not just HTML over
XHTML.  But that's just me...
On Aug 10, 2011 1:06 PM, "Simon Slavin"  wrote:
>
> On 10 Aug 2011, at 5:58pm, Kit wrote:
>
>> 2011/8/10 Brian Curley :
>>> Depending on your preferred shell...the sqlite CLI is just crazy
flexible.
>>> Just pipe your output through sed for upper/lower preferences.
>>
>> It is not entirely primitive. It needs only tags in lowercase.
>>
>> http://www.sqlite.org/sqlite.html;>
>> The last output mode is "html". In this mode, sqlite3 writes the
>> results of the query as an XHTML table.
>> 
>>
>> XHTML tags are in lowercase...
>
> Actually, Kit's right. If that format is meant to be XHTML (and not HTML,
as the in-app help says) then those tags MUST be lower case. The web page
needs changing.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Simon Slavin

On 10 Aug 2011, at 5:58pm, Kit wrote:

> 2011/8/10 Brian Curley :
>> Depending on your preferred shell...the sqlite CLI is just crazy flexible.
>> Just pipe your output through sed for upper/lower preferences.
> 
> It is not entirely primitive. It needs only tags in lowercase.
> 
> http://www.sqlite.org/sqlite.html;>
> The last output mode is "html". In this mode, sqlite3 writes the
> results of the query as an XHTML table.
> 
> 
> XHTML tags are in lowercase...

Actually, Kit's right.  If that format is meant to be XHTML (and not HTML, as 
the in-app help says) then those tags MUST be lower case.  The web page needs 
changing.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Brian Curley
Then you'd need your sed regex to handle that mask accordingly. The CLI is
understandably your best friend in this case.

A rogue's gallery just awaiting you to tell it what to do...I prefer to
model my app using views, and feed it .import files. You might even replace
time and date retrieval logic by piping sqlite output into use.  It's much
better than some on this forum give it credit.

But as mentioned elsewhere: you've got the recompile option too...
On Aug 10, 2011 12:58 PM, "Kit"  wrote:
> 2011/8/10 Brian Curley :
>> Depending on your preferred shell...the sqlite CLI is just crazy
flexible.
>> Just pipe your output through sed for upper/lower preferences.
>
> It is not entirely primitive. It needs only tags in lowercase.
>
> http://www.sqlite.org/sqlite.html;>
> The last output mode is "html". In this mode, sqlite3 writes the
> results of the query as an XHTML table.
> 
>
> XHTML tags are in lowercase...
> --
> Kit
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Kit
2011/8/10 Brian Curley :
> Depending on your preferred shell...the sqlite CLI is just crazy flexible.
> Just pipe your output through sed for upper/lower preferences.

It is not entirely primitive. It needs only tags in lowercase.

http://www.sqlite.org/sqlite.html;>
The last output mode is "html". In this mode, sqlite3 writes the
results of the query as an XHTML table.


XHTML tags are in lowercase...
-- 
Kit
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Black, Michael (IS)
If you don't like upper case then change the code and re-compile.  That's the 
nice part of source code.





Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate




From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Kit [kit.sa...@gmail.com]
Sent: Wednesday, August 10, 2011 11:18 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Shell doesn't do 

2011/8/10 Simon Slavin <slav...@bigfraud.org>:
> I've never tried using this before for some reason but in a recent OS X 
> version of the command-line shell I tried using
> .mode html
> today.  The content is fine, but it doesn't do  or .
> Intentional ?  Bug ?  Oversight ?  Trying hard to believe I'm not the first 
> person who has tried this.
> If someone feels like fixing this, then it should also include  and 
>  as well, but most browsers will infer these.
> If someone claims 'no fix because we have users who rely on this' is there 
> any chance of another mode, perhaps 'htmlfull' which does this ?
> Simon.

Much more I dislike that the tags are uppercase on output. I prefer
lowercase, so this functionality can not be used practically.
--
Kit
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Brian Curley
Depending on your preferred shell...the sqlite CLI is just crazy flexible.
Just pipe your output through sed for upper/lower preferences.
 On Aug 10, 2011 12:18 PM, "Kit"  wrote:
> 2011/8/10 Simon Slavin :
>> I've never tried using this before for some reason but in a recent OS X
version of the command-line shell I tried using
>> .mode html
>> today.  The content is fine, but it doesn't do  or .
>> Intentional ?  Bug ?  Oversight ?  Trying hard to believe I'm not the
first person who has tried this.
>> If someone feels like fixing this, then it should also include 
and  as well, but most browsers will infer these.
>> If someone claims 'no fix because we have users who rely on this' is
there any chance of another mode, perhaps 'htmlfull' which does this ?
>> Simon.
>
> Much more I dislike that the tags are uppercase on output. I prefer
> lowercase, so this functionality can not be used practically.
> --
> Kit
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Kit
2011/8/10 Simon Slavin :
> I've never tried using this before for some reason but in a recent OS X 
> version of the command-line shell I tried using
> .mode html
> today.  The content is fine, but it doesn't do  or .
> Intentional ?  Bug ?  Oversight ?  Trying hard to believe I'm not the first 
> person who has tried this.
> If someone feels like fixing this, then it should also include  and 
>  as well, but most browsers will infer these.
> If someone claims 'no fix because we have users who rely on this' is there 
> any chance of another mode, perhaps 'htmlfull' which does this ?
> Simon.

Much more I dislike that the tags are uppercase on output. I prefer
lowercase, so this functionality can not be used practically.
-- 
Kit
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Simon Slavin
Thanks to everyone, including Michael for a fast work-around.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Black, Michael (IS)
If you want it just DIY...





.mode html

select "";

select * from stuff;

select "";





Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate




From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Roger Binns [rog...@rogerbinns.com]
Sent: Wednesday, August 10, 2011 10:56 AM
To: sqlite-users@sqlite.org
Subject: EXT :Re: [sqlite] Shell doesn't do 

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/10/2011 09:13 PM, Simon Slavin wrote:
> The content is fine, but it doesn't do  or .

My shell copies the SQLite shell and also outputs only rows.  The reason
is that multiple statements could be used to generate output so you do
not assume each one is complete.  eg:

  .mode html
  select x,y from tablea where ...;
  select x,y from tableb where ...;

A full html output would also have to generate html/head/body etc where
it is virtually impossible to guess what the requirements are.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5CqkAACgkQmOOfHg372QT8KgCgrCiEoFK6/73GN7+PxLDXdSZL
qNUAoKFbRqojRSxpe/KjHZ49BYd/nPhR
=kql0
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/10/2011 09:13 PM, Simon Slavin wrote:
> The content is fine, but it doesn't do  or .

My shell copies the SQLite shell and also outputs only rows.  The reason
is that multiple statements could be used to generate output so you do
not assume each one is complete.  eg:

  .mode html
  select x,y from tablea where ...;
  select x,y from tableb where ...;

A full html output would also have to generate html/head/body etc where
it is virtually impossible to guess what the requirements are.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5CqkAACgkQmOOfHg372QT8KgCgrCiEoFK6/73GN7+PxLDXdSZL
qNUAoKFbRqojRSxpe/KjHZ49BYd/nPhR
=kql0
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Shell doesn't do

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 11:43 AM, Simon Slavin  wrote:

> I've never tried using this before for some reason but in a recent OS X
> version of the command-line shell I tried using
>
> .mode html
>
> today.  The content is fine, but it doesn't do  or .
>
> Intentional ?  Bug ?  Oversight ?  Trying hard to believe I'm not the first
> person who has tried this.
>

Intentional.  The idea is that the output from the shell would be
copy/pasted into a larger table that perhaps contains other rows from other
sources.  The SQLite shell was never intended to output a complete HTML
document.


>
> If someone feels like fixing this, then it should also include  and
>  as well, but most browsers will infer these.
>
> If someone claims 'no fix because we have users who rely on this' is there
> any chance of another mode, perhaps 'htmlfull' which does this ?
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Shell doesn't do

2011-08-10 Thread Simon Slavin
I've never tried using this before for some reason but in a recent OS X version 
of the command-line shell I tried using

.mode html

today.  The content is fine, but it doesn't do  or .

Intentional ?  Bug ?  Oversight ?  Trying hard to believe I'm not the first 
person who has tried this.

If someone feels like fixing this, then it should also include  and 
 as well, but most browsers will infer these.

If someone claims 'no fix because we have users who rely on this' is there any 
chance of another mode, perhaps 'htmlfull' which does this ?

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users