问题描述:

I have a tag like this <article mdate="2005-12-08" key="journals/presence/RobinettR92">

How do I say ordering by the tags "name" the name being article for example (this is not the only name so I can't use an absolute path)?

To select ordering by the mdate attribute for example I can use {for i in $item order by $i/@mdate} and that works, but nothing I try seems to sort by the tags name.

网友答案:

To order the tag names, use the local-name(...) function.

for $i in $item
order by local-name($i)
return $i
相关阅读:
Top