Skip to content

Is there a way to set the XPathVersion that came from Request Defaults ? And couple of question about PIP #85

Answered by cdanger
JavaUnchained asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. There are 3 questions that cause difficulties.

I set all parameters for evaluation via api (like Bags.singletonAttributeBag etc... not from jaxb Request). In this case. Is there a way to set the XPathVersion that came from Request Defaults ?

Yes, when you instantiate the XPathCompilerProxy to be passed as argument to the XPathValue constructor, you can set the XPath version. The easy way is to instantiate it with BasicImmutableXPathCompilerProxy class constructor, which takes a XPathVersion argument. Then you can reuse it for each XPathValue (xpathExpression attribute) you create. Here is an example:

final DecisionRequestBuilder<?> reqBuilder = pdpEngine.newRequestBuilder(-1, -1);

/…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JavaUnchained
Comment options

@cdanger
Comment options

Answer selected by JavaUnchained
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants