0

gdata を使用してこの xml ファイルを読み取ろうとしています: ftp://ftp2.bom.gov.au/anon/gen/fwo/IDV10753.xml

パスは //product/forecast/area aac="VIC_PT025" description="Geelong" type="location" parent-aac="VIC_PW007" です。

これの正しい構文は何ですか?

4

2 に答える 2

0

構文

//product/forecast/area[@aac="VIC_PT025" and @description="Geelong" and @type="location" and @parent-aac="VIC_PW007"]

于 2013-10-31T08:14:28.187 に答える
0

area1 つの要素のみを選択しようとしていますか?

その場合、area値が「VIC_PT025」の属性「aac」を持つ要素は、ドキュメント内で一意に見えるので、うまくいくはずです//product/forecast/area[@aac="VIC_PT025"]

すべての属性をテストしたい場合は、使用できます//product/forecast/area[@aac="VIC_PT025" and @description="Geelong" and @type="location" and @parent-aac="VIC_PW007"]

于 2013-10-30T16:21:36.863 に答える