1
for $skill in $allskill
return <skill name = "{data($skill)}">{(for $i in 1 to 5
return (<count level = "{data($i)}" n = "{count($resumeSkills[@what = "SQL" and @level = "5"])}"></count> ))} </skill> 

The snippet of code above works just fine how the code below does not.

for $skill in $allskill
return <skill name = "{data($skill)}">{(for $i in 1 to 5
    return (<count level = "{data($i)}" n = "{count($resumeSkills[@what = "{data($skill)}" and @level = "{data($i)}"])}"></count> ))} </skill>

Any help will be appreciated. Thanks .

1 Answer 1

1

Remove the inner braces and quotes so that the corresponding part become :

n = "{count($resumeSkills[@what=$skill and @level=$i])}"

Notice that in your first XQuery, the quotes acts as delimiter for literal string, while in the second you don't use literal string anymore but using variables so no need for quotes here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.