如何使用 javax.xml.xpath 对 XML 文件执行以下 XQuery?
for $com in //RepoStatistics/Commits/Commit
return
for $file in $com//File
return element tuple {
element path {
string($file/Path)
},
element action {
string($file/@action)
},
element date {
string($com/@date)
},
element developer {
string($com/@author)
},
element locAdd{
if (not(empty($file/LocAdd)))
then string($file/LocAdd)
else 0
},
element locRem{
if (not(empty($file/LocRem)))
then string($file/LocRem)
else 0
}
}
如果这个问题很愚蠢,请原谅,但我是一个非常初学者。