Click here to get back home

Displaying code with

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Displaying code with
Eric Lindsay 12-30-2005
Posted by Jukka K. Korpela on December 30, 2005, 6:59 pm
Please log in for more thread options



> ftp -i -n ftp.server.com< <EOF

That's correct markup and works well, though it represents
ftp -i -n ftp.server.com< <EOF
which is not what you mean. Use
ftp -i -n ftp.server.com &lt;&lt;EOF
instead (i.e., move the space after the first &lt; before it).

> If I leave the << to indicate I am using a Here document, then the WDG
> validator complains about all sorts of stuff.

Of course you must not write the "<" characters as such but e.g. "escape"
them as &lt;. If you use them as such, <EOF will be parsed as starting a tag.
("Escaping" the first "<" isn't strictly necessary in HTML 4.01, but
surely a good idea.)

> If I use adjoining &lt;&lt; with no space, then the first < displays,
> but the rest of the code example disappears.

That would be nasty bug in a browser, but we could probably find a workaround
rather easily (using dummy markup, such as &lt;<span>&lt;</span>, might
help). So far, I can see no direct evidence of such a bug. I just tried on
Firefox 1.0.2, and it shows &lt;&lt; correctly as <<.

> If I add a space between the two &lt; &lt; the code shows, but the use
> of the double << for a Here document isn't clearly shown.

Then there is no "<<" but "< <". That would be a poor workaround to a bug,
but I don't think there _is_ a bug.

> Live page is at http://ericlindsay.com/blog/200508.htm#5 and will show
> one of the three problems.

Well, it contains invalid markup, with <<EOF, so it is guaranteed to be
wrong.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


Similar ThreadsPosted
better/easy way to displaying c source code in html July 18, 2006, 5:44 am
Can't locate problem in HTML code IE ignores but Firefox is displaying. November 29, 2004, 2:01 pm
Why IE7 not displaying picture? November 11, 2006, 9:46 pm
Pictures not displaying May 9, 2008, 4:56 pm
Linked images not displaying October 21, 2005, 6:48 am
Mac IE not displaying background-image June 20, 2006, 6:39 am
Help! Background image not displaying... February 8, 2008, 6:11 pm
Displaying Text As Rollover with Tables March 20, 2005, 3:46 am
pages not displaying properly in safari March 18, 2006, 5:18 pm
Image Not Displaying for Some Firefox Users May 31, 2007, 11:21 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap