Frage : XPath Neuer

Den Code bitte unten betrachten und mich beraten, wie ich in das XPath nicht gerade title but author and price zurück holen kann? (Dank)

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
6:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:


  

  





Attachments:
Bücher XML

Antwort : XPath Neuer

dieses heraus überprüfen
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
Weg = „/bookstore/book [price>35]“;

      //-Code für IE

      wenn (window.ActiveXObject) {
        xmlDoc.setProperty („SelectionLanguage“, „XPath“);
        var book_nodes = xmlDoc.selectNodes (Weg);
        für (i = 0; I < book="">„;
              wenn (book_fields [J] .nodeName == „Preis“)
                buf += „(IE) Preis: “ + book_fields [J] .text + „
„; } } } sonst { //-Code für Mozilla, Firefox, Oper, etc. wenn (document.implementation && document.implementation.createDocument) { var-Nullpunkte = xmlDoc.evaluate (Weg, xmlDoc, Null, XPathResult.ANY_TYPE, Null); var-Resultat = nodes.iterateNext (); während (Resultat) { var book_fields = result.childNodes; für (J = 0; J < book="">„; wenn (book_fields [J] .nodeName == „Preis“) buf += „(Firefox) Preis: “ + book_fields [J] .childNodes [0] .nodeValue + „
„; } Resultat = nodes.iterateNext (); } } }
Weitere Lösungen  
 
programming4us programming4us