tuxji opened a new pull request #373: URL: https://github.com/apache/incubator-daffodil/pull/373
Add two new cases to FunctionCallExpression.functionObject (in file Expression.scala) to allow expressions to call fn:namespace-uri with zero and one arguments and get NodeInfo.AnyURI values. Implement these calls with FNNamespaceUri0 and FNNamespaceUri1 case classes in FNFunctions.scala. These classes implement the calls using the run() method instead of the computeValue() method since the sibling case classes FNLocalName0 and FNLocalName1 (already implemented by someone else) also do that. Some parts tricky to figure out were having to handle run() calls passing DStateForConstantFolding (that's why we call dstate.fnExists() to terminate such calls), how to get the namespace uri from the currentNode, figuring out how to return NodeInfo.AnyURI instead of NodeInfo.String, and figuring out what to do when fn:namespace-uri is called with a currentValue instead of a currentNode. (Please review these new lines of code to make sure they seem correct.) Add a new test case namespace_uri_07 to Functions.tdml to find out what happens when we call fn:namespace-uri with a currentValue instead of a currentNode. Not sure how to test the similar situation where fn:namespace-uri is called without a valid current node to use as "." though. Make sure to run the namespace_uri_03 to namespace_uri_06 test cases in TestDFDLExpressions.scala now that fn:namespace-uri is implemented. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
