重複の可能性:
XQueryがエラーを返す..?
以下はXMLファイルです-
<Continents>
<Continent name="Asia">
<Country name="Japan">
<City name="Tokyo"><Desc>Tokoyo is a most populated City</Desc></City>
<City name="Horishima"><Desc>What to say.. Faced the destruction due to Atom Bomb</Desc></City>
</Country>
<Country name="India">
<City name="New Delhi"><Desc>Capital of India</Desc></City>
<City name="Mumbai"><Desc>Financial Capital of India</Desc></City>
<City name="Lucknow"><Desc>City of Nawabs</Desc></City>
</Country>
</Continent>
</Continents>
国の都市をリストしたい="India"
私のXQueryFLWORコードは-
for $x in doc("Continent")/Continents/Continent
where $x/Country/@name='India'
return $x/Country/City/@name
私は次のように出力したいと思っています-
name="New Delhi" name="Mumbai" name="Lucknow"
しかし、出力を-として取得します
name="Tokyo" name="Horishima" name="New Delhi" name="Mumbai" name="Lucknow"
誰かが私が正しい出力を得るのを手伝ってくれる?また、別の行にそれを取得する方法は?