Christian Kruse: Unterschied Validate/Check if Well-Formed

Beitrag lesen

Hallo Martin,

b) alle XML-Elemente Ende-tags haben

Muss nicht sein. Leere Tags sind erlaubt (<tag/>)

e) die Zeichen <, > und & nicht in den Texten vorkommen
(Ausnahme ist in CDATA)

Nicht ganz korrekt. > ist erlaubt:

|The ampersand character (&) and the left angle bracket (<)
|may appear in their literal form only when used as markup
|delimiters, or within a comment, a processing instruction,
|or a CDATA section. If they are needed elsewhere, they must
|be escaped using either numeric character references or the
|strings "&" and "<" respectively.

Nix ueber 'right angle bracket'. Ueber den steht drin:

|The right angle bracket (>) may be represented using the
|string ">", and must, for compatibility, be escaped using
|">" or a character reference when it appears in the
|string "]]>" in content, when that string is not marking the
|end of a CDATA section.

muss also nur escaped werden, wenn CDATA geschlossen wird.

Naja, ansonsten fehlen noch ein paar Sachen (Attribut darf
nur einmal in einem Tag vorkommen, Zeichensatzspezifisches,

  • in Kommentaren ist nicht erlaubt, etc, etc.) Wer es genau
    wissen will, moege

http://www.w3.org/TR/REC-xml

lesen.

Gruesse,
 CK