/ Forside / Teknologi / Udvikling / HTML / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
HTML
#NavnPoint
molokyle 11184
Klaudi 5506
bentjuul 3377
severino 2040
smorch 1950
strarup 1525
natmaden 1396
scootergr.. 1320
e.c 1150
10  miritdk 1110
Valideringsfejl - entity "tag"
Fra : Preben Nielsen


Dato : 28-05-11 01:12

<img src="http://pr.prchecker.info/getpr.php?
codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1"

giver følgende to valideringsfejl (XHTML1):

1)
cannot generate system identifier for general entity "tag"
…hp?codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1" …
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.

If this error appears in some markup generated by PHP's session
handling code, this article has explanations and solutions to your
problem.

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.

2)
general entity "tag" not defined and no default entity
…hp?codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1" …

This is usually a cascading error caused by a an undefined entity
reference or use of an unencoded ampersand (&) in an URL or body text.
See the previous message for further details.

t'et i &tag=1 er rødmarkeret i begge tilfælde.

Hvordan skal koden se ud for at validere?



 
 
Jens Peter Karlsen (28-05-2011)
Kommentar
Fra : Jens Peter Karlsen


Dato : 28-05-11 09:17

& skal skrives &amp; i et link.
Hvad fejlen siger er at der ikke findes en html entity der hedder
&tag, så i stedet skal det være &amp;tag.

Regards Jens Peter Karlsen.


On Sat, 28 May 2011 00:12:02 -0700 (PDT), Preben Nielsen <pn3@mail.dk>
wrote:

><img src="http://pr.prchecker.info/getpr.php?
>codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1"

Birger Sørensen (28-05-2011)
Kommentar
Fra : Birger Sørensen


Dato : 28-05-11 09:19

Preben Nielsen forklarede den 28-05-2011:
> <img src="http://pr.prchecker.info/getpr.php?
> codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1"
>
> giver følgende to valideringsfejl (XHTML1):
>
> 1)
> cannot generate system identifier for general entity "tag"
> …hp?codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1" …
> 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.
>
> If this error appears in some markup generated by PHP's session
> handling code, this article has explanations and solutions to your
> problem.
>
> 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.
>
> 2)
> general entity "tag" not defined and no default entity
> …hp?codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1" …
>
> This is usually a cascading error caused by a an undefined entity
> reference or use of an unencoded ampersand (&) in an URL or body text.
> See the previous message for further details.
>
> t'et i &tag=1 er rødmarkeret i begge tilfælde.
>
> Hvordan skal koden se ud for at validere?

<img
src="http://pr.prchecker.info/getpr.php?codex=aHR0cDovL3ZpbnNpZGVybmUuZGs=&tag=1"
alt="">

Birger

--
http://varmeretter.dk - billig, sund og hurtig mad
http://bbsorensen.dk



Preben Nielsen (28-05-2011)
Kommentar
Fra : Preben Nielsen


Dato : 28-05-11 02:33

Tak for hjælpen. Det der virker er at udskfite &tag med &amp;tag

/Preben


Birger Sørensen (28-05-2011)
Kommentar
Fra : Birger Sørensen


Dato : 28-05-11 10:28

Preben Nielsen har bragt dette til verden:
> Tak for hjælpen. Det der virker er at udskfite &tag med &amp;tag
>
> /Preben

Forståelsen er vel også vigtig...
& (ampersand) er forbudt i HTML/XHTML fordi det bruges til markering af
entities - &nbsp; &copy; for nu at nævne nogle - og det må/kan derfor
*ikke* anvendes som en almindelig karakter.
Så når browserens parser finder et & leder den efter ; der skal
afslutte enitien, eller en anden karakter der ikke må findes i entities
(= tegnet i dette tilfælde), derefter søger den så efter en entity, med
det den har fundet. Det er &tag i dette tilfælde - og den entity
eksisterer ikke, og det er det fejlen fortæller.
Så når man i HTML/XHTML skal bruge & karakteren, *skal* den skrives
&amp;
Eksempel : Helle &amp; Preben
^^

Birger

--
http://varmeretter.dk - billig, sund og hurtig mad
http://bbsorensen.dk



Søg
Reklame
Statistik
Spørgsmål : 177577
Tips : 31968
Nyheder : 719565
Indlæg : 6409071
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste