Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation error

Status
Not open for further replies.

amiw

Programmer
Apr 1, 2003
113
GB
for validation purposes I am using & in place of & as below

<a href="directory.asp?dir=test&amp;mydir=test">test</a>

This still spits out an validation error, is there anything else I should be doing?
 
What is the error? I had no problems using that syntax ever. What is validator not liking about your code?
 
Line 91, column 95: cannot generate system identifier for general entity "src"

...traveldirectory.asp?url=directory.htm&src=gasta"><img src="/images/...

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!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
 

You need to escape the & before src, as the error implies. The line shown in your second post is not the same as in the first.

Use "&amp;src=" instead of "&src=".

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
oops sorry for the mistake with the posting.

Dan that's exactly what I've done though I get a validation error.

I use this .traveldirectory.asp?url=directory.htm&amp;src=gasta"><img src="/images and still get the error message above. I've done a search on google and many people have the same problem though I can't find a solution.

any ideas
 

Do you have a URL we can view the source at?

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Making the fix I suggested to both occurrences of &src in the file got it validating for me.

Are you sure converted all instances?

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
The page you just provided does not have both ampersands escaped. Are you sure you uploaded the newest version on the server?
 
That's strange when I make the changes to

<div align="right"><a href=" src="/images/banners/anigoo.gif" alt="ASP VB and .NET Components" border="0" width="125" height="125"></a></div>
ASP VB and .NET Components for <a href=" Image and Upload</a></td>

and then upload, the code changes...

the &amp; converts back to &

any ideas?
 

Are you sure you are actually uploading the page at all? Are you sure the page you are viewing is the page you are uploading? Try making some regular text changes and see if they come through.

Whatever the case, I'd say you know how to fix your problem now.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top