Include surprise

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Include surprise

jc-15
Here's an odd one.

Using this code directly in my template works as expected:


<table cellpadding=0 cellspacing=0 border=0>
                <tr>
                                        <td valign="middle" align="center" class="[if: $pageID ==
'index']menuItemSelected[else]menuItem[/if]"><a
href="index.lasso?page=lukcmain&pgID=index">Kongresscentrum</a></td>
                                        <td valign="middle" align="center" class="[if: $pageID ==
'lokaler']menuItemSelected[else]menuItem[/if]"><a
href="index.lasso?page=lukcmain&pgID=lokaler">Lokaler</a></td>
                                        <td valign="middle" align="center" class="[if: $pageID ==
'kontakt']menuItemSelected[else]menuItem[/if]"><a
href="index.lasso?page=lukcmain&pgID=kontakt">Kontakt</a></td>
                                        <td valign="middle" align="center" class="[if: $pageID ==
'omLund']menuItemSelected[else]menuItem[/if]"><a
href="index.lasso?page=lukcmain&pgID=omLund">Om Lund </a></td>
                </tr>
        </table>

Puttin the exact same code in another file and including it into the
template with [Include:$header_page] messes it up. The resulting web
page will not display in the same way. The item are dislocated...?

HDB
JC


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Paul Melia
Sounds like an HTML issue.
Trying running your page through the w3c html validator...

http://validator.w3.org/

HTH,
Paul


On May 21, 2005, at 7:17 PM, JC wrote:

> Here's an odd one.
>
> Using this code directly in my template works as expected:
>
>
> <table cellpadding=0 cellspacing=0 border=0>
>         <tr>
>                     <td valign="middle" align="center" class="[if:  
> $pageID == 'index']menuItemSelected[else]menuItem[/if]"><a  
> href="index.lasso?page=lukcmain&pgID=index">Kongresscentrum</a></td>
>                     <td valign="middle" align="center" class="[if:  
> $pageID == 'lokaler']menuItemSelected[else]menuItem[/if]"><a  
> href="index.lasso?page=lukcmain&pgID=lokaler">Lokaler</a></td>
>                     <td valign="middle" align="center" class="[if:  
> $pageID == 'kontakt']menuItemSelected[else]menuItem[/if]"><a  
> href="index.lasso?page=lukcmain&pgID=kontakt">Kontakt</a></td>
>                     <td valign="middle" align="center" class="[if:  
> $pageID == 'omLund']menuItemSelected[else]menuItem[/if]"><a  
> href="index.lasso?page=lukcmain&pgID=omLund">Om Lund </a></td>
>         </tr>
>     </table>
>
> Puttin the exact same code in another file and including it into  
> the template with [Include:$header_page] messes it up. The  
> resulting web page will not display in the same way. The item are  
> dislocated...?
>
> HDB
> JC
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  http://www.listsearch.com/ 
> lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

jc-15
In reply to this post by jc-15
I tried the validator and it found nothing to complain about  
regarding my mystery code. But, it did complain about something else.

When I write URLs I write them like this:

http://kongresscentrum.lu.se/index.lasso?
action=index_event&page=lukcevent&pgID=event_index&f_evID=7F0000010a02d2
A6BBPtu3317CBE
(all in one line)

But, the validator complained saying I can't use ampersands without  
encoding them?
This is the message in validator:"

An entity reference was found in the document, but there is no  
reference by that name defined. Often this is caused by misspelling  
the reference name, unencoded ampersands, or by leaving off the  
trailing semicolon (;). The most common cause of this error is  
unencoded ampersands in URLs as described by the WDG in "Ampersands  
in URLs".

Entity references start with an ampersand (&) and end with a  
semicolon (;). If you want to use a literal ampersand in your  
document you must encode it as "&amp;" (even inside URLs!)."

I thought my way of writing the URL was the natural way?

HDB
JC

22 maj 2005 kl. 02.47 skrev Paul Melia:

> Sounds like an HTML issue.
> Trying running your page through the w3c html validator...
>
> http://validator.w3.org/
>
> HTH,
> Paul
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

James Harvard
In reply to this post by jc-15
When you write and ampersand in HTML you have to encode it. So if you want to give a link a title of "Terms & conditions" you have to write <a href="/terms/" title="Terms &amp; conditions">.

The same is true of URLs - if your URL is article.lasso?id=23&section=2 then when you come to put that into an HTML document you have encode the ampersands thus <a href="article.lasso?id=23&amp;section=2">.

HTH,
James Harvard

>I tried the validator and it found nothing to complain about regarding my mystery code. But, it did complain about something else.
>
>When I write URLs I write them like this:
>
>http://kongresscentrum.lu.se/index.lasso?action=index_event&page=lukcevent&pgID=event_index&f_evID=7F0000010a02d2A6BBPtu3317CBE
>(all in one line)
>
>But, the validator complained saying I can't use ampersands without encoding them?

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

James Harvard
In reply to this post by jc-15
I'm afraid I do not understand what you mean. Does Lasso not produce the HTML that you want, or does the browser render the same HTML differently? If the browser is displaying the same HTML in a different way you should check that your CSS is loading correctly for both pages.
James Harvard

>Here's an odd one.
>
>Using this code directly in my template works as expected:
>
>
><table cellpadding=0 cellspacing=0 border=0>
> <tr>
> <td valign="middle" align="center" class="[if: $pageID == 'index']menuItemSelected[else]menuItem[/if]"><a href="index.lasso?page=lukcmain&pgID=index">Kongresscentrum</a></td>
> <td valign="middle" align="center" class="[if: $pageID == 'lokaler']menuItemSelected[else]menuItem[/if]"><a href="index.lasso?page=lukcmain&pgID=lokaler">Lokaler</a></td>
> <td valign="middle" align="center" class="[if: $pageID == 'kontakt']menuItemSelected[else]menuItem[/if]"><a href="index.lasso?page=lukcmain&pgID=kontakt">Kontakt</a></td>
> <td valign="middle" align="center" class="[if: $pageID == 'omLund']menuItemSelected[else]menuItem[/if]"><a href="index.lasso?page=lukcmain&pgID=omLund">Om Lund </a></td>
> </tr>
> </table>
>
>Puttin the exact same code in another file and including it into the template with [Include:$header_page] messes it up. The resulting web page will not display in the same way. The item are dislocated...?
>
>HDB
>JC

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

jc-15
In reply to this post by jc-15
I can understand encoding ampersands in plain text. But why in URLs?  
The ampersand have a special (reserved) meaning in URLs.

And who does it? This is a link from OmniPilots  
DataBaseBrowser.LassoApp:

<a href="/DataBaseBrowser.0.LassoApp?
tab1=browse&tab2=html&tab3=settings" class="tab3">

And this is a testlink produced in Dreamweaver:
a href="/DataBaseBrowser.0.LassoApp?
tab1=browse&tab2=html&tab3=settings" class="tab3"">URLtest</a>

Hm, neither encode any ampersands...

So we have a standard that "no one" use and no one have to use. Or  
are there situations where unencoded ampersands in URLs will destroy  
something?

HDB
JC

23 maj 2005 kl. 18.50 skrev James Harvard:

> When you write and ampersand in HTML you have to encode it. So if  
> you want to give a link a title of "Terms & conditions" you have to  
> write <a href="/terms/" title="Terms &amp; conditions">.
>
> The same is true of URLs - if your URL is article.lasso?
> id=23&section=2 then when you come to put that into an HTML  
> document you have encode the ampersands thus <a href="article.lasso?
> id=23&amp;section=2">.
>
> HTH,
> James Harvard
>
>
>> I tried the validator and it found nothing to complain about  
>> regarding my mystery code. But, it did complain about something else.
>>
>> When I write URLs I write them like this:
>>
>> http://kongresscentrum.lu.se/index.lasso?
>> action=index_event&page=lukcevent&pgID=event_index&f_evID=7F0000010a0
>> 2d2A6BBPtu3317CBE
>> (all in one line)
>>
>> But, the validator complained saying I can't use ampersands  
>> without encoding them?
>>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Clive Bruton
In reply to this post by jc-15

On 24 May, 2005, at 08:19, JC wrote:

> So we have a standard that "no one" use and no one have to use. Or are
> there situations where unencoded ampersands in URLs will destroy
> something?

Well, the theory is that you could get a string like this:

        blah.lasso?day=tue&copy=1

Where "&copy" will get interpreted as the copyright character (it
doesn't seem to matter to those building the standards that the correct
entity here is "&copy;", so "&copy" shouldn't be interpreted  anyway).
So the "get" arguments would be broken by a broken browser trying to
insert a copyright symbol.


-- Clive


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

jc-15
In reply to this post by jc-15
And a quick test proves your point.
blah.lasso?day=tue&copy=1 does indeed produce a copyright char in  
Safari.

[Philosophical_question]
Why then are there so many not encoding ampersands in URLs?  
Dreamweaver? Omnipilot?
[/Philosophical_question]

[Real_question]
Are there situations where encoded ampersands in a URL can ruin the  
link?
[/Real_question]

HDB
JC
24 maj 2005 kl. 10.59 skrev Clive Bruton:

>
> On 24 May, 2005, at 08:19, JC wrote:
>
>
>> So we have a standard that "no one" use and no one have to use. Or  
>> are there situations where unencoded ampersands in URLs will  
>> destroy something?
>>
>
> Well, the theory is that you could get a string like this:
>
>     blah.lasso?day=tue&copy=1
>
> Where "&copy" will get interpreted as the copyright character (it  
> doesn't seem to matter to those building the standards that the  
> correct entity here is "&copy;", so "&copy" shouldn't be  
> interpreted  anyway). So the "get" arguments would be broken by a  
> broken browser trying to insert a copyright symbol.
>
>
> -- Clive
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  http://www.listsearch.com/ 
> lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Simon Forster
In reply to this post by jc-15
If you use Apache, use mod_rewrite to accept "standard" urls and  
rewrite them to the appropriate URL with args. Recently I retrofitted  
this to a simple site to help with search engine placements and it  
worked very well. For example <http://www.study-tours.org/catalogue/ 
courseList/by/subject/id/Historical%20Tours> is rewritten as <http://
www.study-tours.org/courseList.lasso?by=subject&id=Historical%
20Tours>. On more recent sites I have an adapted Model, View,  
Controller (MVC) approach to coding which makes this mechanism even  
easier to implement. In future I plan to use this approach to URL  
writing as the default.

ATB

Simon Forster
_____________________________________________________
  LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
  Tel: +44 (0)70 9230 5244   Fax: +44 (0)70 9230 5247
_____________________________________________________


On 24 May 2005, at 13:27, JC wrote:


> And a quick test proves your point.
> blah.lasso?day=tue&copy=1 does indeed produce a copyright char in  
> Safari.
>
> [Philosophical_question]
> Why then are there so many not encoding ampersands in URLs?  
> Dreamweaver? Omnipilot?
> [/Philosophical_question]
>
> [Real_question]
> Are there situations where encoded ampersands in a URL can ruin the  
> link?
> [/Real_question]
>
> HDB
> JC
> 24 maj 2005 kl. 10.59 skrev Clive Bruton:
>
>
>
>>
>> On 24 May, 2005, at 08:19, JC wrote:
>>
>>
>>
>>
>>> So we have a standard that "no one" use and no one have to use.  
>>> Or are there situations where unencoded ampersands in URLs will  
>>> destroy something?
>>>
>>>
>>>
>>
>> Well, the theory is that you could get a string like this:
>>
>>     blah.lasso?day=tue&copy=1
>>
>> Where "&copy" will get interpreted as the copyright character (it  
>> doesn't seem to matter to those building the standards that the  
>> correct entity here is "&copy;", so "&copy" shouldn't be  
>> interpreted  anyway). So the "get" arguments would be broken by a  
>> broken browser trying to insert a copyright symbol.
>>
>>
>> -- Clive
>>



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Greg Willits
In reply to this post by jc-15
On May 24, 2005, at 5:27 AM, JC wrote:

> And a quick test proves your point.
> blah.lasso?day=tue&copy=1 does indeed produce a copyright char in
> Safari.
>
> [Philosophical_question]
> Why then are there so many not encoding ampersands in URLs?
> Dreamweaver? Omnipilot?
> [/Philosophical_question]

Why are there so many people writing web pages without doctypes and
with a mixture of HTML3 & 4 syntax that don't validate?  ;-)

Most of the time & does not cause a problem, so it continues to be
imitated. I wasn't aware of either until the first time I saw James
mention it.

Who here knows every rule/standard for HTML, XHTML, CSS, JavaScript,
LP8, MySQL 4.1 -- I have a job for you if you do :-)

-- greg willits


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

jc-15
In reply to this post by jc-15
I don't. Prefer to have a life... But Macromedia should not have a  
software like Dreamweaver produce HTML that is not compliant.

HDB
Jolle

24 maj 2005 kl. 19.17 skrev Greg Willits:


> Who here knows every rule/standard for HTML, XHTML, CSS,  
> JavaScript, LP8, MySQL 4.1 -- I have a job for you if you do :-)
>
>



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Bil Corry
In reply to this post by jc-15
> But Macromedia should not have a  
> software like Dreamweaver produce HTML that is not compliant.

Perhaps they are mirroring Microsoft.  Ever look at Front Page-produced code?  

- Bil

------

Bil Corry
[hidden email]

Enterprise internet application development and security consulting
  http://www.fivegeeks.com/

Tools for Rapid Lasso Development
  http://www.lassoware.com/
 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
JC
Sent: Tuesday, May 24, 2005 1:17 PM
To: [hidden email]
Subject: Re: Include surprise

I don't. Prefer to have a life... But Macromedia should not have a  
software like Dreamweaver produce HTML that is not compliant.

HDB
Jolle

24 maj 2005 kl. 19.17 skrev Greg Willits:


> Who here knows every rule/standard for HTML, XHTML, CSS,  
> JavaScript, LP8, MySQL 4.1 -- I have a job for you if you do :-)
>
>




--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Clive Bruton
In reply to this post by jc-15

On 24 May, 2005, at 13:27, JC wrote:

> And a quick test proves your point.
> blah.lasso?day=tue&copy=1 does indeed produce a copyright char in
> Safari.

I think MS browsers do the same thing - but IMO this is "broken" syntax
and shouldn't be interpreted anyway. I though of another really *super*
example:

        blah.lasso?volts=12&amps=10

Well you can work out for yourself what that may become - again a
broken browser fixing broken syntax, which isn't really broken at all.

> [Philosophical_question]
> Why then are there so many not encoding ampersands in URLs?
> Dreamweaver? Omnipilot?
> [/Philosophical_question]

I think you shouldn't really see them so much, as when they actually
appear in your address bar you just see the "&", you should only see
the "&amp;" if you view the source (or at least that's what I think
should happen).

But like Greg suggests, who knows every rule? Mailing "Madobe" and
asking for a "bug fix" may get it into a future version of Dreamweaver
- but they may already know and have taken a contrary view to the W3C
as to how bad syntax should be handled.

> [Real_question]
> Are there situations where encoded ampersands in a URL can ruin the
> link?
> [/Real_question]

I suspect that, as this is an invention to fix people's bad HTML coding
in "helpful" browsers, then there are probably examples where this
workaround produces its own unexpected results - but I don't know of
any off the top of my head.


-- Clive


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

jc-15
In reply to this post by jc-15
That was funny :-) Really. Bil Corry bringing up Front Page was not.  
Now I will have nightmares again... ;-/

And with a slight change the &amp failed in my Safari test.
blah.lasso?volts=12&amps=10 works. blah.lasso?volts=12&amp=10  
doesn't. Figure that out?

HDB
JC

25 maj 2005 kl. 00.04 skrev Clive Bruton:


> blah.lasso?volts=12&amps=10
>



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

James Harvard
In reply to this post by jc-15
At 2:27 pm +0200 24/5/05, JC wrote:
>And a quick test proves your point.
>blah.lasso?day=tue&copy=1 does indeed produce a copyright char in Safari.
>
>[Philosophical_question]
>Why then are there so many not encoding ampersands in URLs? Dreamweaver? Omnipilot?
>[/Philosophical_question]

To be fair Omnipilot/Blueworld did fix Lasso 7 so that when Lasso adds a session param to links it does correctly use '&amp;-session='. And if you look at say the 'contact us' link on http://www.listsearch.com/ you can see that they're doing it correctly there.

But you are right in general - very few people correctly encode &s in links. But then, as Greg pointed out, very few people produce valid HTML markup. (More and more are now, but still most markup out there does not validate.)

I don't know for sure, because I don't use a visual HTML editor, but I believe that recent versions of DW & GL do (or can be configured to) create standards-compliant code, which would require them to correctly encode &.

People find it surprising because it is hard to believe that one has been doing something so fundamental incorrectly, without ever noticing any problems. But forget for a moment how you have been writing your <a> tags up until now. In HTML some characters have special meaning, like &, so when used literally they have to be encoded. This applies to the values of tag attributes, like href in <a>. You doubtless knew already that if you write "This & that" in HTML you have to encode it as "This &amp; that", so it follows that when you want to write an ampersand in a href attribute you have to encode it.

As I think I said before it's worth remembering that this means that you also have to do things like this ...
<a href="/terms/" title="Terms &amp; condidtions">Our terms</a>
<input type="text" name="job" value="D&eacute;sign &amp; build web sites">
... and of course not forgetting that if you are outputting values from Lasso in such places you will have to ensure correct encoding is applied if there might be special HTML characters ...
<option value="[encode_html: $some_map->(find:'some_key') ]">Some value</option>

>[Real_question]
>Are there situations where encoded ampersands in a URL can ruin the link?
>[/Real_question]

No. Just as a browser renders <p>This &amp; that</p> as "This & that" on the page, so if you hover the cursor over the link <a href="blah.lasso?day=true&amp;copy=1"> then you will see blah.lasso?day=true&copy=1 in the browser's status bar. The same is true if you retrieve the href value using JavaScript. The URL is still "blah.lasso?day=true&copy=1", but if you want to put that into an HTML document you have to encode it correctly.

It's no different from encoding characters like spaces in URLs. The URL might be "foo.lasso?msg=This%20%26%20that" but the server then decodes the URL just as a browser decodes HTML encoding, so when you do (action_param:'msg') in Lasso you get "This & that".

Oops - didn't mean to write an essay!

James Harvard

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Clive Bruton
In reply to this post by jc-15

On 25 May, 2005, at 12:25, James Harvard wrote:

> You doubtless knew already that if you write "This & that" in HTML you
> have to encode it as "This &amp; that", so it follows that when you
> want to write an ampersand in a href attribute you have to encode it.

I don't think that follows at all, because in older specs this wasn't
required, and probably would fail, and other characters with special
meanings are not encoded, ie, you don't do this:

        <a href=&quot;www.helloworld.com&quot;>

or even:

        &lt;a href=&quot;www.helloworld.com&quot;&gt;

Ampersands not to be interpreted should only appear within quotes
anyway, so there's no ambiguity, this whole thing is only there to deal
with non-compliant browsers that try to interpret "broken" entities.


-- Clive


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Fletcher Sandbeck
In reply to this post by jc-15
On 5/25/05 at 3:43 PM by [hidden email] (Clive Bruton):

>On 25 May, 2005, at 12:25, James Harvard wrote:
>
>> You doubtless knew already that if you write "This & that" in HTML you
>> have to encode it as "This &amp; that", so it follows that when you
>> want to write an ampersand in a href attribute you have to encode it.
>
>I don't think that follows at all, because in older specs this wasn't
>required, and probably would fail, and other characters with special
>meanings are not encoded, ie, you don't do this:
>
> <a href=&quot;www.helloworld.com&quot;>
>
>or even:
>
> &lt;a href=&quot;www.helloworld.com&quot;&gt;
>
>Ampersands not to be interpreted should only appear within quotes
>anyway, so there's no ambiguity, this whole thing is only there to deal
>with non-compliant browsers that try to interpret "broken" entities.

The second is perfectly valid HTML.  That's how you would display that literal string in a browser.

The characters <>=""& are HTML markup characters.  These characters have special meanings in HTML and are used to create the structure of an HTML document.

If you want to display a markup character on a page then you have to use an HTML entity.  For example, to display a less-than character on a page you use &lt;.  The ampersand is a markup character that signifies the start of an entity.  Thus, if you want to display the markup character & on a page, it should itself be an entity &amp;.

However, the browsers are forgiving of lax markup.  For example, browsers have no problem display a greater-than character on a page > as long as it is not internal to a tag.  Stray > characters should be encoding as &gt;, but in practice it doesn't matter.  

Stray & characters should also be encoded as &amp;, but again it doesn't usually matter because the HTML parser will only interpret them as the start of an HTML entity if the string that follows defines a valid HTML entity.  &lt; will display as a less-than character, but &xt; will just display as-is in most browsers since xt is not a valid entity name.

Even worse, most browsers will interpret &lt as a less-than character even without the missing ;.

XHTML is not nearly as forgiving as straight HTML in how its markup characters are used.  You can get away with lax encoding in most HTML browsers, but as you start to create more structured documents like XHTML documents or RSS feeds, the details start to matter.  A stray ampersand in an XHTML document can cause parsing to fail.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Lasso Product Specialist              [hidden email]
OmniPilot, Software Inc.                http://www.omnipilot.com

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

James Harvard
In reply to this post by jc-15
At 3:43 pm +0100 25/5/05, Clive Bruton wrote:
>I don't think that follows at all, because in older specs this wasn't required, and probably would fail,

Objection, Your Honour! HTML 2 does require encoding of ampersands in attribute values:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.catalogue-host.co.uk%2Fhtml_2_valid.html
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.catalogue-host.co.uk%2Fhtml_2_invalid.html

>and other characters with special meanings are not encoded, ie, you don't do this:
        <a href=&quot;www.helloworld.com&quot;>

True, one doesn't do that, but in your example above the quotes are being used for their special meaning - i.e. as delimiters for the attribute value.

James

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Douglas Burchard
In reply to this post by jc-15

On May 25, 2005, at 7:43 AM, Clive Bruton wrote:

> I don't think that follows at all, because in older specs this  
> wasn't required, and probably would fail...

Not so. Here's a quote from the HTML 2.0 specs from 1996:

             NOTE - The URI from a query form submission can be
             used in a normal anchor style hyperlink.
             Unfortunately, the use of the `&' character to
             separate form fields interacts with its use in SGML
             attribute values as an entity reference delimiter.
             For example, the URI `http://host/?x=1&y=2' must be
             written `<a href="http://host/?x=1&#38;y=2"' or `<a
             href="http://host/?x=1&amp;y=2">'.

             HTTP server implementors, and in particular, CGI
             implementors are encouraged to support the use of
             `;' in place of `&' to save users the trouble of
             escaping `&' characters this way.

     Reference: <http://www.ietf.org/rfc/rfc1866.txt>


I couldn't immediately find the HTML 1.0 specs, but I suspect they  
say the same thing since the issue is with the much older (1970s) SGML.


--
Douglas Burchard, President
DouglasBurchard.com, Web Applications
15024 NE 66th Street
Redmond, WA  98052, USA

direct: (206) 227-8161
[hidden email]
http://www.douglasburchard.com/


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Include surprise

Clive Bruton
In reply to this post by jc-15

On 25 May, 2005, at 16:19, Fletcher Sandbeck wrote:

> The second is perfectly valid HTML.  That's how you would display that
> literal string in a browser.

Sure, but that's not my point, that you couldn't build a useful link
with these entities - thus it's not valid mark-up for the use intended.


-- Clive


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
12