BaseX is complaining about a nested query of mine. I do not understand why it cannot return multiple lines like it did in the first query. The error says, "Expecting }, found >" and the >
it is referring to is the >
after name under trips. It works fine if the }
is after the close-bracket for id, but obviously, that's not what I want. Here is the query:
for $u in doc("export.xml")/database/USERS/tuple
return
<user>
<login>{$u/USERNAME/text()}</login>
<email></email>
<name></name>
<affiliation></affiliation>
<friend></friend>
<trip>
{for $t in doc("export.xml")/database/TRIPS/tuple
where $t/ADMIN/text() = $u/USERNAME/text()
return
<id> {$t/ID/text()} </id>
<name> {$t/NAME/text()} </name> (: Error is here with <name> :)
<feature> {$t/FEATURE/text()} </feature>
<privacyFlag> {$t/PRIVACY/text() </privacyFlag>)
}
</trip>
</user>