We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
According to docs, sum and multiply is implemented, but I can't get this to work:
func main() { doc, err := xmlquery.Parse(strings.NewReader(` <items> <item type="goods"> <quantity unit="pcs">1</quantity> <unit-price currency="PLN">2</unit-price> <VAT>7</VAT> </item> <item type="goods"> <quantity unit="pcs">10</quantity> <unit-price currency="PLN">20</unit-price> <VAT>7</VAT> </item> <item type="goods"> <quantity unit="pcs">100</quantity> <unit-price currency="PLN">200</unit-price> <VAT>7</VAT> </item> </items> `)) expr, err := xpath.Compile("sum(/items/item/(quantity * unit-price))") if err != nil { panic(err) } res := expr.Evaluate(xmlquery.CreateXPathNavigator(doc)).(float64) print(res) }
This code panics with panic: sum(/items/item/(quantity * unit-price)) has an invalid token
panic: sum(/items/item/(quantity * unit-price)) has an invalid token
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
According to docs, sum and multiply is implemented, but I can't get this to work:
This code panics with
panic: sum(/items/item/(quantity * unit-price)) has an invalid token
The text was updated successfully, but these errors were encountered: