Thomas L.: XHTML, Links mit mehreren Variablen

Beitrag lesen

Moin!

Die Verwendung der oben genannten Variante mit den Raute-Zeichen (#). Ich hab die RFC2141 jetzt nicht im Kopf, dort ist aber das Aussehen der URI festgelegt. Die DTDs von XHTML sehen für das Element A eine Attribut href vom Typ URI vor, der in o.g. RFC festgelegt wird.
Ich denke, du erzählst hier Unsinn. Die Raute ich  (IMHO auch noch im XHTML) bei Links als Sprungziel für Anker vorgesehen. Die kannst du nicht einfach umwidmen in ein Trennzeichen für URL-Parameter.
Abgesehen davon definiert RFC 2141 das Aussehen einer URN, nicht einer URI. Die wird in RFC2396 festgelegt.
Kurze Ergänzung:
Zitat von http://www.ietf.org/rfc/rfc2141.txt:
"2.4 Excluded characters
The following list is included only for the sake of completeness.
Any octets/characters on this list are explicitly NOT part of the URN
character set, and if used in an URN, MUST be %encoded:
<excluded> ::= octets 1-32 (1-20 hex) | "" | """ | "&" | "<"
| ">" | "[" | "]" | "^" | "`" | "{" | "|" | "}" | "~"                 | octets 127-255 (7F-FF hex)"
D.h., das &-Zeichen ist explizit verboten. Ein Encoding als %26 bringt jedoch keine erwünschte Wirkung.
Das &-Zeichen ist als Wert eines Parameterstrings explizit verboten, weil es das Trennzeichen der Parameter ist. Wenn du die Variable namens "gmbh&co" übergeben willst, muß diese "gmbh%3dco" heißen. Gleiches gilt, wenn der Wert einer Variablen ein &-Zeichen enthält.
Zitat RFC 2396: http://www.ietf.org/rfc/rfc2396.txt
2.2. Reserved Characters
   Many URI include components consisting of or delimited by, certain
   special characters.  These characters are called "reserved", since
   their usage within the URI component is limited to their reserved
   purpose.  If the data for a URI component would conflict with the
   reserved purpose, then the conflicting data must be escaped before
   forming the URI.
      reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                    "$" | ","
   The "reserved" syntax class above refers to those characters that are
   allowed within a URI, but which may not be allowed within a
   particular component of the generic URI syntax; they are used as
   delimiters of the components described in Section 3.
3.4. Query Component
   The query component is a string of information to be interpreted by
   the resource.
      query         = *uric
   Within a query component, the characters ";", "/", "?", ":", "@",
   "&", "=", "+", ",", and "$" are reserved.
Und schließlich schreibt das W3 selbst in http://www.w3.org/TR/2000/REC-xhtml1-20000126/#guidelines:
C.12 Using Ampersands in Attribute Values
When an attribute value contains an ampersand, it must be expressed as a character entity reference (e.g. "&"). For example, when the href attribute of the a element refers to a CGI script that takes parameters, it must be expressed as http://my.site.dom/cgi-bin/ myscript.pl?class=guest&name=user rather than as http://my.site.dom/cgi- bin/myscript.pl?class=guest&name=user.

  • Sven Rautenberg

OK, Ok, OK, ich ziehe alles zurück :-(  Du hast ja sowas von Recht... Korrektes Quellenfinden ist halt doch nicht immer so einfach. Also nochmals Danke & ein schönes WE

Thomas