c# - Microsoft.Xml.XQuery math expression error -
i'm newer in microsoft.xml.xquery, when i'm trying run xquery math expression sum have error : cannot apply add non integer data.
xml:
<book category="cooking"> <title lang="en">everyday italian</title> <author>giada de laurentiis</author> <year>2005</year> <price>30.00</price> </book>
xquery:
for $item in document("xqt")/bookstore/book[price < '30'] return $item/year/text() + $item/year/text()
c#:
xmldocument doc1 = new xmldocument(); doc1.loadxml(rtexml.text); xquerynavigatorcollection navcol = new xquerynavigatorcollection(); navcol.addnavigator(doc1.createnavigator(), "xqt"); xqueryexpression expr = new xqueryexpression(rtexquery.text.trim().replace("\\n", " ")); xquerynavigator nav = expr.execute(navcol); rteoutput.text = nav.toxml();
any ideas?
for $item in document("xqt")/bookstore/book[price < '30'] return sum($item/year/text(), $item/price/text())
Comments
Post a Comment