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" です。
これの正しい構文は何ですか?
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" です。
これの正しい構文は何ですか?
構文
//product/forecast/area[@aac="VIC_PT025" and @description="Geelong" and @type="location" and @parent-aac="VIC_PW007"]
area
1 つの要素のみを選択しようとしていますか?
その場合、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"]