& in einer Option-Box gibt Fehler beim Validator - schlimm?
-
Moin!
Ich habe in einer Option-Box (Klappauswahlliste) mehrere Einträge mit einem & drin.
Die bemeckert der Validator in den verschiedensten Versionen.
Die längste Meldung ist:Warning Line 44 column 82: cannot generate system identifier for general entity "Drop".
.../viewtopic-var-t-is-39087.html">Drag&Drop mit CListCtrl</option>
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 "&" (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 æ 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.
Die anderen sind dann Errors und verweisen auf diese Warning.
Kann ich das so lassen?
Oder muss ich da nun extra aus jedem & ein & machen?
-
Da das & selbst eine Steuersequenz in XML/HTML einleitet, muss natürlich jedes & zu & gemacht werden..
(Oder woher soll er wissen dass Dein & gerade keine Steuersequenz einleitet?
)
-
Hmm, hast ja Recht.
Aber es geht weder so
Drag "&" Drop
noch so
Drag & Drop
Der meckert immer
cannot generate system identifier for general entity "amp".
-
Bist du sicher, dass da nicht woanders noch was schief liegt? Der folgende Code geht problemlos durch:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head><title>C/C++ Forum :: Thema anzeigen - & in einer Option-Box gibt Fehler beim Validator - schlimm?</title> </head> <body> <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }"> <option value="-1">Forum auswählen</option> <optgroup label="Frameworks"><option value="1">M & F "&" C (Visual C++)</option> </optgroup> </select> </body> </html>
PS.
Das mit dem Abfangen der Umlaute und Sonderzeichen kommt in die nächste Version des Indexers.
-
Jansen schrieb:
Bist du sicher, dass da nicht woanders noch was schief liegt?
Jaja, man sollte so einen Tester auch benutzen können.
Ich hab das Gerüst rundherum wohl vergessen.PS.
Das mit dem Abfangen der Umlaute und Sonderzeichen kommt in die nächste Version des Indexers.Okay, danke.
Ich mache mich jetzt erstmal auf die Suche nach allen <br> und <p>, die da noch rumschwirren.