Обсуждение: sgml and "empty" closing tags
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>
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
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
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
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
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 SHORTTAGYES 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 SHORTTAGYES
Alex Hunsaker escreveu: > BTW anyone know how to escape < and > for google? > You can escape < and > using < and >, respectively. -- Euler Taveira de Oliveira http://www.timbira.com/
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 < and >, respectively. Searching for <foo looks for documents containing "lt" and "foo", not documents containing "<foo". ...Robert
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 < and >, respectively. > > Searching for <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/