Folgendes ist alles in JavaScript.Zugriff auf Attribut- und Textwerte von Elementen in XPathResult?
Ich habe die folgende XML
<Hotels>
<Hotel category='standard'>Hotel 1</Hotel>
<Hotel category='superior'>Hotel 2</Hotel>
</Hotels>
Meine 'Ergebnisse' von meinem XPath ("// Hotel") mit einer Länge von ein Array zurückgibt 2.
Was mache ich als nächstes zu bekommen bei den Kategoriewerten und dem Text.
dh results[0].???? //will give me category value
und results[0].???? //will give me the text
"Hotel 1 Hotel 2" sieht nicht wie XML aus. Welche Sprache benutzt du? –
Das Ergebnis ist ein Knotensatz. Also für jeden Knoten @ Kategorie geben Sie die Kategorie und Text() gibt Ihnen den Text – time4tea
Sie sind nur Namen von Hotels – nexar