You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Peter Galbavy <pe...@photasmagoria.com> on 2003/01/08 18:24:01 UTC

unknown entity blah - '&' problem

Using the w3c validator, I get 'unknown entity' error for URL generated
using $Server->URL().

--
Line 8, column 75: cannot generate system identifier for general entity
"session-id"
  ..."
href="/css/style.css?category=misc&session-id=0aa89fea729d35f3cee8cb638927a
--

comment at:

http://validator.w3.org/docs/errors.html#bad-entity :-
--
A reference to a URI that uses & as a separator between parameters, such as
http://example.org/prog?x=1&y=2.

To solve this problem, simply replace all the &'s in attribute values with
&amp; (user agents will convert them back before following the links.)

Another way to get around this problem is for the author of the CGI program
to allow a different value to be used between arguments, like ';' or '|',
which would allow the link to be coded as e.g. <a
href="http://example.org/prog?x=1;y=2">
--

I didn't know this was ever a problem, but in light of this, is their anyway
to change the query string seperator or set it to (optional) '&amp;' ? I
find this bizarre, as I have been using plain '&' forever, but I would have
thought that W3C know what they are talking about.

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Thanos Chatziathanassiou <tc...@arx.gr>.
Peter Galbavy wrote:

>>Actually, you're supposed to say ``&amp;'' instead of plain ``&''.
>>See also RFC 1738.
>>You can, however, also use ``;'' as a QueryString delimeter.
>>    
>>
>
>That's cool - now how do we politely ask Apache::ASP to use ';' instead of
>'&' internally ? :-)
>
I don't suppose you can..
``;'' just works when you construct querystrings yourself.
I was hasty in my answer before, so I sent the message before I read 
this problem was created by SessionQueryParse.

Help anyone (Josh ?) ?



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Peter Galbavy <pe...@photasmagoria.com>.
> Actually, you're supposed to say ``&amp;'' instead of plain ``&''.
> See also RFC 1738.
> You can, however, also use ``;'' as a QueryString delimeter.

That's cool - now how do we politely ask Apache::ASP to use ';' instead of
'&' internally ? :-)

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Peter Galbavy <pe...@photasmagoria.com>.
> $Server->URL may or may not be used in generating URLs for use
> in HTML, so will not get this patch.  The problem is specific to
> rendering & in HTML, not with & in URLs.  If you want to escape
> & in $Server->URL generated URLs, you might try
> 
>    $Server->HTMLEncode($Server->URL($url, \%params));

Good point. Lucky someone is watching :)

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Josh Chamas <jo...@chamas.com>.
Peter Galbavy wrote:
> And $Server->URL() ???
> 
> If it is a small patch or one line fix (for the two) then just those - I
> am trying to run a live server with as few 'upgrades' as possible :)
> 

$Server->URL may or may not be used in generating URLs for use
in HTML, so will not get this patch.  The problem is specific to
rendering & in HTML, not with & in URLs.  If you want to escape
& in $Server->URL generated URLs, you might try

   $Server->HTMLEncode($Server->URL($url, \%params));

You can create a shortcut for this of course in global.asa.

For the patch, you may look at the diffs between releases for
the Response.pm module after 2.51 is out.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Peter Galbavy <pe...@photasmagoria.com>.
And $Server->URL() ???

If it is a small patch or one line fix (for the two) then just those - I
am trying to run a live server with as few 'upgrades' as possible :)

Peter

----- Original Message -----
From: "Josh Chamas" <jo...@chamas.com>
To: "Thanos Chatziathanassiou" <tc...@arx.gr>
Cc: <as...@perl.apache.org>; "Peter Galbavy"
<pe...@photasmagoria.com>
Sent: Thursday, January 09, 2003 9:27 AM
Subject: Re: unknown entity blah - '&' problem


> Thanos Chatziathanassiou wrote:
> > Peter Galbavy wrote:
> >
> >> Using the w3c validator, I get 'unknown entity' error for URL
generated
> >> using $Server->URL().
> >>
> >> --
> >> Line 8, column 75: cannot generate system identifier for general
entity
> >> "session-id"
> >>  ..."
> >>
href="/css/style.css?category=misc&session-id=0aa89fea729d35f3cee8cb6389
27a
> >>
> >> --
> >>
> >>
> > Actually, you're supposed to say ``&amp;'' instead of plain ``&''.
> > See also RFC 1738.
> > You can, however, also use ``;'' as a QueryString delimeter.
> >
>
> Right.  SessionQueryParse should be adding &amp; to the query strings,
> not & for proper HTML.  This has been true for enough years now that
> browsers support this, that I am OK with this.
>
> I'll have this added to the 2.51 release, let me know if you want the
> development release early.
>
> Regards,
>
> Josh
> ________________________________________________________________
> Josh Chamas, Founder                   phone:925-552-0128
> Chamas Enterprises Inc.                http://www.chamas.com
> NodeWorks Link Checking                http://www.nodeworks.com
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Josh Chamas <jo...@chamas.com>.
Thanos Chatziathanassiou wrote:
> Peter Galbavy wrote:
> 
>> Using the w3c validator, I get 'unknown entity' error for URL generated
>> using $Server->URL().
>>
>> -- 
>> Line 8, column 75: cannot generate system identifier for general entity
>> "session-id"
>>  ..."
>> href="/css/style.css?category=misc&session-id=0aa89fea729d35f3cee8cb638927a 
>>
>> -- 
>>  
>>
> Actually, you're supposed to say ``&amp;'' instead of plain ``&''.
> See also RFC 1738.
> You can, however, also use ``;'' as a QueryString delimeter.
> 

Right.  SessionQueryParse should be adding &amp; to the query strings,
not & for proper HTML.  This has been true for enough years now that
browsers support this, that I am OK with this.

I'll have this added to the 2.51 release, let me know if you want the
development release early.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Thanos Chatziathanassiou <tc...@arx.gr>.
Peter Galbavy wrote:

>Using the w3c validator, I get 'unknown entity' error for URL generated
>using $Server->URL().
>
>--
>Line 8, column 75: cannot generate system identifier for general entity
>"session-id"
>  ..."
>href="/css/style.css?category=misc&session-id=0aa89fea729d35f3cee8cb638927a
>--
>  
>
Actually, you're supposed to say ``&amp;'' instead of plain ``&''.
See also RFC 1738.
You can, however, also use ``;'' as a QueryString delimeter.

Regards,
Thanos Chatziathanassiou




---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: unknown entity blah - '&' problem

Posted by Peter Galbavy <pe...@photasmagoria.com>.
> Using the w3c validator, I get 'unknown entity' error for URL generated
> using $Server->URL().
>
> --
> Line 8, column 75: cannot generate system identifier for general entity
> "session-id"
>   ..."
>
href="/css/style.css?category=misc&session-id=0aa89fea729d35f3cee8cb638927a
> --

Thinking about this, this was *not* generated using $Server-URL() but by
SessionQueryParse etc.

Same issue(s) though...

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org