From 52847d58250190734ea48a65899a4156ce5bf690 Mon Sep 17 00:00:00 2001 From: John C Barstow Date: Wed, 15 Jan 2014 15:22:11 +1300 Subject: [PATCH] Register XPath namspaces before evaluating for-each --- xslt/instruction.go | 1 + 1 file changed, 1 insertion(+) diff --git a/xslt/instruction.go b/xslt/instruction.go index 21db072..108ae20 100644 --- a/xslt/instruction.go +++ b/xslt/instruction.go @@ -369,6 +369,7 @@ func (i *XsltInstruction) Apply(node xml.Node, context *ExecutionContext) { case "for-each": scope := i.Node.Attr("select") e := xpath.Compile(scope) + context.RegisterXPathNamespaces(i.Node) nodes, _ := context.EvalXPathAsNodeset(node, e) if i.sorting != nil { i.Sort(nodes, context)