473,722 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with "&" changing to "&"

A lot of Firefox users I know, says they have problems with validation
where the ampersand sign has to be written as & to be valid. I don't
have Firefox my self and don't wont to install it only because of this,
so I hope some of you gurus can enlighten me with this :)

In what circumstances can the "&" in the source code be involuntary
changed to "&" by a browser when or other software, when editing and
uploading the file to the web server?

E.g. writing a string like "sc_project=402 887&java=0& amp;security"
is changed to "sc_project=402 887&java=0&secu rity" when the validator is
processing the code, without the editor doing the change deliberately.

TIA

--
/Arne

Proud User of SeaMonkey. Get your free copy:
http://www.mozilla.org/projects/seamonkey/
May 10 '06 #1
14 5932

Arne wrote:
A lot of Firefox users I know, says they have problems with validation


In the route from editor to server to on-line validator, just where
does Firefox (or any browser) have anything to do with it?

Your question, as stated, has too much missing from it to make any
sense.

May 10 '06 #2
In our last episode,
<4c************ *@individual.ne t>,
the lovely and talented Arne
broadcast on comp.infosystem s.www.authoring.html:
A lot of Firefox users I know, says they have problems with validation
where the ampersand sign has to be written as &amp; to be valid. I don't
have Firefox my self and don't wont to install it only because of this,
so I hope some of you gurus can enlighten me with this :)
This doesn't make any sense. & should be &amp; anywhere in any html
document unless the & is the beginning of a character reference. Validity
does not depend upon the browser, but is a property the document may or may
not have regardless of the browser. Browser should correctly translate
character references in URLs when they fetch, but so far as I know and I can
tell from testing, Firefox does that.
In what circumstances can the "&amp;" in the source code be involuntary
changed to "&" by a browser when or other software, when editing and
uploading the file to the web server?
I can't make any sense of this. Browsers shouldn't be doing anything to
files they upload, and I never heard of one that did. I'm not sure what
happens if you use a browser function to insert the contents of a file in a
textarea, but that is not the same thing as uploading a file.
E.g. writing a string like "sc_project=402 887&amp;java=0& amp;security"
If you write this in a file and save it and then upload the file, the
following should not happen:
is changed to "sc_project=402 887&java=0&secu rity" when the validator is
processing the code, without the editor doing the change deliberately.

--
Lars Eighner us****@larseigh ner.com http://www.larseighner.com/
I have not seen as far as others because giants were standing on my shoulders.
May 10 '06 #3
Once upon a time *Andy Dingley <di*****@codesm iths.com>* wrote:
Arne wrote:
A lot of Firefox users I know, says they have problems with
validation


In the route from editor to server to on-line validator, just where
does Firefox (or any browser) have anything to do with it?

Your question, as stated, has too much missing from it to make any
sense.


Yes, I do belive it's a bit difficult to understand. :)
I'll try with an example as it is described to me.

On a remote visitor tracker site (statcounter.co m) when the tracker code
that is to be pasted on a page, is generated using Firefox, the code to
copy is shown in a text box. Part of the code is what I used in my
initial post ("sc_project=40 2887&java=0&sec urity"). In my browser and
also in IE, this part shows the ampersands as "&amp;".

When I look at the source code for the page where the box with the
generated code is, the ampersand shows as "&amp;amp", but when I
validate the page, the W3C validator also complains about the "&", where
the "&amp;" (or "&amp;amp") should be.

This page is HTML 4.0 Transitional with 9 errors, and most of the errors
(6-7) is because of the ampersand is not shown as "&amp;"

I know it's hard to understand this, and I for sure have no idea. I was
hoping somebody could have some theory what's happening. :)

--
/Arne

Proud User of SeaMonkey. Get your free copy:
http://www.mozilla.org/projects/seamonkey/
May 10 '06 #4
To further the education of mankind, Arne <in*****@domain .invalid>
vouchsafed:
When I look at the source code for the page where the box with the
generated code is, the ampersand shows as "&amp;amp", but when I
validate the page, the W3C validator also complains about the "&", where
the "&amp;" (or "&amp;amp") should be.


What do you mean "should be"? You just said "&amp;amp" was in the source
code. This would display "&amp" in the viewport. So where does the lone
"&" come from? (Btw, note that the "&amp" is incorrect. It should be
"&amp;".)

--
Neredbojias
Infinity has its limits.
May 10 '06 #5
Arne wrote:
Once upon a time *Andy Dingley <di*****@codesm iths.com>* wrote:
Arne wrote:
A lot of Firefox users I know, says they have problems with
validation

In the route from editor to server to on-line validator, just where
does Firefox (or any browser) have anything to do with it?

Your question, as stated, has too much missing from it to make any
sense.


Yes, I do belive it's a bit difficult to understand. :)
I'll try with an example as it is described to me.

On a remote visitor tracker site (statcounter.co m) when the tracker code
that is to be pasted on a page, is generated using Firefox, the code to
copy is shown in a text box. Part of the code is what I used in my
initial post ("sc_project=40 2887&java=0&sec urity"). In my browser and
also in IE, this part shows the ampersands as "&amp;".

When I look at the source code for the page where the box with the
generated code is, the ampersand shows as "&amp;amp", but when I
validate the page, the W3C validator also complains about the "&", where
the "&amp;" (or "&amp;amp") should be.

This page is HTML 4.0 Transitional with 9 errors, and most of the errors
(6-7) is because of the ampersand is not shown as "&amp;"

I know it's hard to understand this, and I for sure have no idea. I was
hoping somebody could have some theory what's happening. :)


I'm still having trouble understanding, but try this: if you have
"&amp;" in your string, and you need it to read as "&amp;" in the
browser, then you need to change it to "&amp;amp;" . Not "&amp;amp", as
you wrote twice, but "&amp;amp;" . "&amp;amp" will be interpreted as
"&amp", which is indeed invalid.
May 10 '06 #6
Once upon a time *Harlan Messinger* wrote:
Arne wrote:
Once upon a time *Andy Dingley <di*****@codesm iths.com>* wrote:
Arne wrote:
A lot of Firefox users I know, says they have problems with
validation
In the route from editor to server to on-line validator, just where
does Firefox (or any browser) have anything to do with it?

Your question, as stated, has too much missing from it to make any
sense.


Yes, I do belive it's a bit difficult to understand. :)
I'll try with an example as it is described to me.

On a remote visitor tracker site (statcounter.co m) when the tracker code
that is to be pasted on a page, is generated using Firefox, the code to
copy is shown in a text box. Part of the code is what I used in my
initial post ("sc_project=40 2887&java=0&sec urity"). In my browser and
also in IE, this part shows the ampersands as "&amp;".

When I look at the source code for the page where the box with the
generated code is, the ampersand shows as "&amp;amp", but when I
validate the page, the W3C validator also complains about the "&", where
the "&amp;" (or "&amp;amp") should be.

This page is HTML 4.0 Transitional with 9 errors, and most of the errors
(6-7) is because of the ampersand is not shown as "&amp;"

I know it's hard to understand this, and I for sure have no idea. I was
hoping somebody could have some theory what's happening. :)


I'm still having trouble understanding, but try this: if you have
"&amp;" in your string, and you need it to read as "&amp;" in the
browser, then you need to change it to "&amp;amp;" . Not "&amp;amp", as
you wrote twice, but "&amp;amp;" . "&amp;amp" will be interpreted as
"&amp", which is indeed invalid.


Yes, the "&amp;amp" was a typo from me, but only here. *I* can see
"&amp;amp;" in the source code of the page containing the code (in the
box) for the tracker. In the "web view" mode (the actual page) the code
in the text box shows &amp; for *me*. It's like having "&amp;" in the
page source to see "&" on the page.

But Firefox users see only "&" in the text box that and when they paste
the tracker code to their pages, the code of course don't validate. The
question is why Firefox don't show the tracker code in the box as
SeaMonkey and IE does?

The content in the text box is like plain text in Notepad, but Firefox
is transforming the &amp; to a & even if everything else is as it
should. Firefox users have to add the "amp;" manually to make it valid
code. I guess most can do it, but should not really need to when the
generator is preparing a "ready to copy" code.

And I'm just trying to figure out why this happend only on Firefox. :)

--
/Arne

Proud User of SeaMonkey. Get your free copy:
http://www.mozilla.org/projects/seamonkey/
May 10 '06 #7
Once upon a time *Lars Eighner* wrote:
In our last episode,
<4c************ *@individual.ne t>,
the lovely and talented Arne
broadcast on comp.infosystem s.www.authoring.html:
A lot of Firefox users I know, says they have problems with validation
where the ampersand sign has to be written as &amp; to be valid. I don't
have Firefox my self and don't wont to install it only because of this,
so I hope some of you gurus can enlighten me with this :)


This doesn't make any sense. & should be &amp; anywhere in any html
document unless the & is the beginning of a character reference. Validity
does not depend upon the browser, but is a property the document may or may
not have regardless of the browser. Browser should correctly translate
character references in URLs when they fetch, but so far as I know and I can
tell from testing, Firefox does that.
In what circumstances can the "&amp;" in the source code be involuntary
changed to "&" by a browser when or other software, when editing and
uploading the file to the web server?


I can't make any sense of this. Browsers shouldn't be doing anything to
files they upload, and I never heard of one that did. I'm not sure what
happens if you use a browser function to insert the contents of a file in a
textarea, but that is not the same thing as uploading a file.
E.g. writing a string like "sc_project=402 887&amp;java=0& amp;security"


If you write this in a file and save it and then upload the file, the
following should not happen:
is changed to "sc_project=402 887&java=0&secu rity" when the validator is
processing the code, without the editor doing the change deliberately.

Well, you are not the only one that can't make any sense of this. But
the fact is (as it's told to me anyway) when Firefox users generate the
code(see my other posts) that is "ready to copy" for everybody else (it
seams) they have to manually add the "amp;" part after the "&" to make
it valid code.

If I should see the same in my browsers (SeaMonkey and IE) I may have
suspected e.g. the code generator script, or the firewall. But if the
error is there, why does it affect only Firefox.

If anybody with Firefox in this NG would go to www.statcounter.com and
register for an tracker account, they could see if it happends to them.
However, I don't expect anybody to do it, only because of this. I don't
install Firefox because of it. :)

--
/Arne

Proud User of SeaMonkey. Get your free copy:
http://www.mozilla.org/projects/seamonkey/
May 10 '06 #8
Arne wrote:
Well, you are not the only one that can't make any sense of this. But
the fact is (as it's told to me anyway) when Firefox users generate the
code(see my other posts) that is "ready to copy" for everybody else (it
seams) they have to manually add the "amp;" part after the "&" to make
it valid code.

If I should see the same in my browsers (SeaMonkey and IE) I may have
suspected e.g. the code generator script, or the firewall. But if the
error is there, why does it affect only Firefox.

If anybody with Firefox in this NG would go to www.statcounter.com and
register for an tracker account, they could see if it happends to them.
However, I don't expect anybody to do it, only because of this. I don't
install Firefox because of it. :)


OK, I get the point. For everyone else: StatCounter gives you code to
add a hit counter to your page, and gives you a number of options for
how it should look and operate. Once you've made your selections, it
gives you code like the following, in a TEXTAREA for some reason, so you
can copy and paste it to your web page.

<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javas cript">
var sc_project=nnnn nn;
var sc_invisible=0;
var sc_partition=11 ;
var sc_security="11 111111";
</script>

<script type="text/javascript" language="javas cript"
src="http://www.statcounter .com/counter/counter.js"></script><noscrip t><a
href="http://www.statcounter .com/" target="_blank" ><img
src="http://c12.statcounter .com/counter.php?sc_ project=nnnnnn& java=0&security =1111111&invisi ble=0"
alt="free invisible hit counter" border="0"></a> </noscript>
<!-- End of StatCounter Code -->
The above was pasted from Firefox, and you can see that the query string
for counter.php has literal ampersands ("&"). If you View Page Source,
it shows "&amp;".

In IE, the code as displayed in the TEXTAREA has the "&amp;":

src="http://c12.statcounter .com/counter.php?sc_ project=nnnnnn& amp;java=0&amp; security=111111 1&amp;invisible =0"

View Source shows the underlying code to be "&amp;amp;" .

So it looks as though Firefox is throwing in an extra round of replacements.
May 10 '06 #9
Once upon a time *Harlan Messinger* wrote:
Arne wrote:
Well, you are not the only one that can't make any sense of this. But
the fact is (as it's told to me anyway) when Firefox users generate the
code(see my other posts) that is "ready to copy" for everybody else (it
seams) they have to manually add the "amp;" part after the "&" to make
it valid code.

If I should see the same in my browsers (SeaMonkey and IE) I may have
suspected e.g. the code generator script, or the firewall. But if the
error is there, why does it affect only Firefox.

If anybody with Firefox in this NG would go to www.statcounter.com and
register for an tracker account, they could see if it happends to them.
However, I don't expect anybody to do it, only because of this. I don't
install Firefox because of it. :)


OK, I get the point. For everyone else: StatCounter gives you code to
add a hit counter to your page, and gives you a number of options for
how it should look and operate. Once you've made your selections, it
gives you code like the following, in a TEXTAREA for some reason, so you
can copy and paste it to your web page.

<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javas cript">
var sc_project=nnnn nn;
var sc_invisible=0;
var sc_partition=11 ;
var sc_security="11 111111";
</script>

<script type="text/javascript" language="javas cript"
src="http://www.statcounter .com/counter/counter.js"></script><noscrip t><a
href="http://www.statcounter .com/" target="_blank" ><img
src="http://c12.statcounter .com/counter.php?sc_ project=nnnnnn& java=0&security =1111111&invisi ble=0"
alt="free invisible hit counter" border="0"></a> </noscript>
<!-- End of StatCounter Code -->
The above was pasted from Firefox, and you can see that the query string
for counter.php has literal ampersands ("&"). If you View Page Source,
it shows "&amp;".

In IE, the code as displayed in the TEXTAREA has the "&amp;":

src="http://c12.statcounter .com/counter.php?sc_ project=nnnnnn& amp;java=0&amp; security=111111 1&amp;invisible =0"

View Source shows the underlying code to be "&amp;amp;" .

So it looks as though Firefox is throwing in an extra round of replacements.


Thank you Harlan, it's a relief to see that it really is as what's told
me and I'm sorry I could not explain it better (as you did). My English
is far from what I wish it to be. :D

Is this something that could be reported as a bug in Firefox, if it's
not done yet? If we don't have any Firefox gurus in this group. :)

--
/Arne

Proud User of SeaMonkey. Get your free copy:
http://www.mozilla.org/projects/seamonkey/
May 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5291
by: NotGiven | last post by:
I changed my POST to GET and find appended to the url, the above string. Why and what can I do to NOT have them appended? Thanks.
4
14798
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following expression: .... snip ...
14
2734
by: Peter Mount | last post by:
Hello I'm having trouble with " scanf("%c", &answer);" on line 20 below. When I run the program in cygwin on Windows 98SE it skips that line completely and ends the program. Does scanf have problems with "%c" or is it the operating system I'm using? 1 #include <stdio.h> 2 3 int main()
5
3440
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot; &lt;me@mydomain.com&gt;</Address> </Addresses>
6
1941
by: Rich | last post by:
Hello, I have to create a table in an Access mdb (remotely) on the fly. Create Table tbl1(fld1 Integer, fld2 varchar(10), fld3...) Then I have to insert data: Insert Into tbl1 Values(" & val1 & ", '" & val2 & "',...")"
3
3098
by: divya | last post by:
Hi, I have a table tblbwday with 2 fields Name and Birthday.I have written this script for displaying evryday names of the people on that day. <% set objConn =server.createobject("ADODB.connection") objConn.open "DSN=Photo" Dim sqlSELsite,ObjRSSel sqlSELsite = "SELECT Name FROM tblbwday WHERE B'day ="& date() &" " '
13
2803
by: Ragnar | last post by:
Hi, 2 issues left with my tidy-work: 1) Tidy transforms a "&amp;" in the source-xml into a "&" in the tidied version. My XML-Importer cannot handle it 2) in a long <title>-string a wrap is produced like: <title>my very long title blab la blab la Blabla bla </title> Importer also has got problems with it
3
2195
by: Pappy | last post by:
SHORT VERSION: Python File B changes sys.stdout to a file so all 'prints' are written to the file. Python file A launches python file B with os.popen("./B 2>&^1 >dev/null &"). Python B's output disappears into never-never land. LONG VERSION: I am working on a site that can kick off large-scale simulations. It will write the output to an html file and a link will be emailed to the user. Also, the site will continue to display...
1
1600
by: Amith | last post by:
Here we are facing a problem which is when we pass a parameter to javascript putting '&' . Ex: &contact. In Japanese OS when we receive this parameter in the script '&' is converted to 'e'.So script is not recognizing the same. In english OS this working fine. Do anyone have any idea.........................
0
8739
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5995
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.