For faster navigation, this Iframe is preloading the Wikiwand page for XML Base.

XML Base

aus Wikipedia, der freien Enzyklopädie

XML Base ist eine vom World Wide Web Consortium empfohlene Möglichkeit, Basis-URLs für Teile von XML-Dokumenten zu definieren. Basis-URL bezeichnet dabei diejenige URL, von der aus relative Pfadangaben im Dokument aufgelöst werden. Die XML Base-Empfehlung wurde am 27. Juni 2001 eingeführt.

Das xml:base-Attribut kann in XML-Dokumenten an beliebiger Stelle eingefügt werden, um eine andere Basis-URL als die des Dokumentes oder einer externen URI bzw. externen Entität zu verwenden. Der Wert des Attributes wird als URI-Referenz, wie in RFC 2396[1] definiert, interpretiert, nachdem er wie in Teil 3.1 der Spezifikation verarbeitet wurde.

In XML-Prozessoren, die XML-Namensräume berücksichtigen, ist das „xml“-Präfix an die Namespace-Bezeichnung gebunden, wie dort unter Namespaces in XML beschrieben. Trotzdem kann xml:base auch von Prozessoren genutzt werden, die keine Namensräume verarbeiten.[2]

Das folgende XML-Dokument befinde sich am Ort file:///var/www/beispiel.xml

<body xmlns="http://www.w3.org/1999/xhtml">
  <a href="/wiki/XML_Base">Link 1</a>
  <a xml:base="http://de.wikipedia.org" href="/wiki/XML_Base">Link 2</a>
  <div xml:base="file:///home/user/">
    <a href="test2.xml">Link 3</a>
    <a xml:base="ordner" href="test3.xml">Link 4</a>
  </div>
</body>

Dann werden die Links folgendermaßen aufgelöst:

  1. Link 1 führt zu file:///wiki/XML_Base
  2. Link 2 zu http://de.wikipedia.org/wiki/XML_Base
  3. Link 3 zu file:///home/user/test2.xml
  4. Link 4 zu file:///home/user/ordner/test3.xml

Einzelnachweise

[Bearbeiten | Quelltext bearbeiten]
  1. RFC 2396 – Uniform Resource Identifiers (URI): Generic Syntax. August 1998 (englisch).
  2. The “xml:” Namespace. In: w3.org. 26. Oktober 2009, abgerufen am 14. September 2019 (englisch).
{{bottomLinkPreText}} {{bottomLinkText}}
XML Base
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?