简单的 XQuery 开始于
Simple XQuery starts-with
我正在学习 xml 东西,无法让这个简单的 Xquery 工作。
XML:
<ModuleList>
<Module id="U08606">
<ModuleName>Discrete Mathematics</ModuleName>
</Module>
</ModuleList>
我正在尝试 return 属性 ID 以 "U086"
开头的名称
XQuery:
for $i in doc("q1.xml")//ModuleList/Module
where starts-with($i/id, 'U086')
return $i/ModuleName
什么都没有 returned atm,有什么想法吗?干杯
使用 @
符号选择属性:
starts-with($i/@id, 'U086')
我正在学习 xml 东西,无法让这个简单的 Xquery 工作。
XML:
<ModuleList>
<Module id="U08606">
<ModuleName>Discrete Mathematics</ModuleName>
</Module>
</ModuleList>
我正在尝试 return 属性 ID 以 "U086"
开头的名称XQuery:
for $i in doc("q1.xml")//ModuleList/Module
where starts-with($i/id, 'U086')
return $i/ModuleName
什么都没有 returned atm,有什么想法吗?干杯
使用 @
符号选择属性:
starts-with($i/@id, 'U086')