Alle Links, die ein neues Fenster öffnen, selektieren

Aufgabenstellung

Quelldokument

<document id="1">
  <content>
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      </head>
      <body>
        <div>
          <ul>
            <li><a href="http://www.google.de/" target="_new">http://www.google.de/Google</a>
              <ul>
                <li><a href="http://earth.google.de/">Google Earth</a></li>
                <li><a href="http://picasa.google.de/intl/de/" target="_new">Picasa</a></li>
              </ul>
            </li> 
            <li><a href="http://www.heise.de/" target="_new">Heise</a></li> 
            <li><a href="http://www.yahoo.de/">Yahoo</a></li> 
          </ul>
        </div>
      </body>
    </html>
  </content>
</document>

Aufgabe

Sammeln Sie alle Links im Dokument (XHTML-Element vom Typ a, die an den Namensraum http://www.w3.org/1999/xhtml gebunden sind), die in einem neuen Fenster geöffnet werden (Attribut "target=_new").

Gewünschte Selektion (XML-Ausgabe)

  • <a href="http://www.google.de/" target="_new" xmlns="http://www.w3.org/1999/xhtml">http://www.google.de/Google</a>
  • <a href="http://picasa.google.de/intl/de/" target="_new" xmlns="http://www.w3.org/1999/xhtml">Picasa</a>
  • <a href="http://www.heise.de/" target="_new" xmlns="http://www.w3.org/1999/xhtml">Heise</a>

Verfügbare Präfixe für den XPath-Ausdruck

PräfixNamensraum
xhttp://www.w3.org/1999/xhtml

Übung

Ihre Eingabe

Eine Lösung wäre: Lösung