sgml and "empty" closing tags

Started by Alex Hunsakerabout 16 years ago9 messages
#1Alex Hunsaker
badalex@gmail.com

While looking over the writable cte patch I noticed queries.sgml has
lots of things in the form "<literal>FROM</>". I tried various
googles to see if </> is some kind of sgml/xml shorthand for close the
last opened tag. But alas, nothing found. Bad google foo?

Should we change those to be the right closing tag? aka </literal>

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alex Hunsaker (#1)
Re: sgml and "empty" closing tags

Alex Hunsaker <badalex@gmail.com> writes:

While looking over the writable cte patch I noticed queries.sgml has
lots of things in the form "<literal>FROM</>". I tried various
googles to see if </> is some kind of sgml/xml shorthand for close the
last opened tag. But alas, nothing found. Bad google foo?

Apparently --- it's perfectly legal in SGML. (I think not in XML.)

Should we change those to be the right closing tag? aka </literal>

You'd be wasting your time.

I don't think it's good style to use </> when the opening tag is far
away or there are other tags between. But for examples like the one
you cite, it's perfectly reasonable.

regards, tom lane

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: sgml and "empty" closing tags

Tom Lane wrote:

Alex Hunsaker <badalex@gmail.com> writes:

While looking over the writable cte patch I noticed queries.sgml has
lots of things in the form "<literal>FROM</>". I tried various
googles to see if </> is some kind of sgml/xml shorthand for close the
last opened tag. But alas, nothing found. Bad google foo?

Apparently --- it's perfectly legal in SGML. (I think not in XML.)

Correct on both counts.

cheers

andrew

#4Alex Hunsaker
badalex@gmail.com
In reply to: Tom Lane (#2)
Re: sgml and "empty" closing tags

On Mon, Nov 16, 2009 at 20:41, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Apparently --- it's perfectly legal in SGML.  (I think not in XML.)

Cool. Thanks!

BTW anyone know how to escape < and > for google? I tried searching
for it-- but ran into a chick and egg situation. So the I tried
various forms of "google search left angle bracket", quotes,
backslashes and "+". no luck

#5Robert Haas
robertmhaas@gmail.com
In reply to: Alex Hunsaker (#4)
Re: sgml and "empty" closing tags

On Mon, Nov 16, 2009 at 10:54 PM, Alex Hunsaker <badalex@gmail.com> wrote:

On Mon, Nov 16, 2009 at 20:41, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Apparently --- it's perfectly legal in SGML.  (I think not in XML.)

Cool.  Thanks!

BTW anyone know how to escape < and > for google? I tried searching
for it-- but ran into a chick and egg situation.  So the I tried
various forms of "google search left angle bracket", quotes,
backslashes and "+". no luck

I don't think you can. I gather that the Google text search algorithm
is word-based. It seems like you can't search for things that it
doesn't consider to be words. It has a pretty expansive notion of
what a word is (like "2a43" is a word, for example) but any non-word
characters are ignored (so, for example, "2a43$" returns the same hits
as "2a43").

...Robert

#6Peter Eisentraut
peter_e@gmx.net
In reply to: Alex Hunsaker (#1)
Re: sgml and "empty" closing tags

On mån, 2009-11-16 at 20:30 -0700, Alex Hunsaker wrote:

While looking over the writable cte patch I noticed queries.sgml has
lots of things in the form "<literal>FROM</>". I tried various
googles to see if </> is some kind of sgml/xml shorthand for close the
last opened tag. But alas, nothing found. Bad google foo?

If you have DocBook installed locally, you should have a file called
docbook.dcl, which contains the "SGML declaration" of DocBook, and
somewhere down contains this:

FEATURES

MINIMIZE
DATATAG NO
OMITTAG NO
RANK NO
SHORTTAG YES

So if you google for something like "markup minimization shorttag", you
can find more information.

For amusement, contrast this with the SGML declaration of HTML:

FEATURES
MINIMIZE
DATATAG NO
OMITTAG YES <-- This is why you can omit <body>, for example.
RANK NO
SHORTTAG YES

In reply to: Alex Hunsaker (#4)
Re: sgml and "empty" closing tags

Alex Hunsaker escreveu:

BTW anyone know how to escape < and > for google?

You can escape < and > using &lt; and &gt;, respectively.

--
Euler Taveira de Oliveira
http://www.timbira.com/

#8Robert Haas
robertmhaas@gmail.com
In reply to: Euler Taveira de Oliveira (#7)
Re: sgml and "empty" closing tags

On Tue, Nov 17, 2009 at 6:39 PM, Euler Taveira de Oliveira
<euler@timbira.com> wrote:

Alex Hunsaker escreveu:

BTW anyone know how to escape < and > for google?

You can escape < and > using &lt; and &gt;, respectively.

Searching for &lt;foo looks for documents containing "lt" and "foo",
not documents containing "<foo".

...Robert

In reply to: Robert Haas (#8)
Re: sgml and "empty" closing tags

Robert Haas escreveu:

On Tue, Nov 17, 2009 at 6:39 PM, Euler Taveira de Oliveira
<euler@timbira.com> wrote:

Alex Hunsaker escreveu:

BTW anyone know how to escape < and > for google?

You can escape < and > using &lt; and &gt;, respectively.

Searching for &lt;foo looks for documents containing "lt" and "foo",
not documents containing "<foo".

Ops, didn't read 'for google'. I thought that the OP was asking about escaping
those identifiers in SGML.

--
Euler Taveira de Oliveira
http://www.timbira.com/