Skip to content

Commit

Permalink
CAMEL-19918: camel-saxon - Using saxon=true does not work. (#11635)
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus authored Oct 3, 2023
1 parent 3f6d9eb commit 231e3be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<bean name="saxonFactory" class="net.sf.saxon.xpath.XPathFactoryImpl"/>

<bean name="xpath" class="org.apache.camel.language.xpath.XPathLanguage">
<property name="useSaxon" value="true"/>
<property name="saxon" value="true"/>
</bean>

<camelContext xmlns="http://camel.apache.org/schema/spring">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class XPathLanguage extends SingleInputTypedLanguageSupport implements Pr
private QName resultQName;
private Class<?> documentType;
private XPathFactory xpathFactory;
private Boolean useSaxon;
private Boolean saxon;
private String objectModelUri;
private Boolean threadSafety;
private Boolean logNamespaces;
Expand Down Expand Up @@ -97,12 +97,22 @@ public void setXpathFactory(XPathFactory xpathFactory) {
this.xpathFactory = xpathFactory;
}

@Deprecated
public void setUseSaxon(Boolean useSaxon) {
this.useSaxon = useSaxon;
setSaxon(useSaxon);
}

@Deprecated
public Boolean getUseSaxon() {
return useSaxon;
return getSaxon();
}

public Boolean getSaxon() {
return saxon;
}

public void setSaxon(Boolean saxon) {
this.saxon = saxon;
}

public String getObjectModelUri() {
Expand Down Expand Up @@ -150,7 +160,7 @@ protected void configureBuilder(XPathBuilder builder, Object[] properties) {
if (clazz != null) {
builder.setResultType(clazz);
}
Boolean bool = property(Boolean.class, properties, 3, useSaxon);
Boolean bool = property(Boolean.class, properties, 3, saxon);
if (bool != null) {
builder.setUseSaxon(bool);
if (bool) {
Expand Down Expand Up @@ -216,6 +226,9 @@ public boolean configure(CamelContext camelContext, Object target, String name,
case "useSaxon":
setUseSaxon(PropertyConfigurerSupport.property(camelContext, Boolean.class, value));
return true;
case "saxon":
setSaxon(PropertyConfigurerSupport.property(camelContext, Boolean.class, value));
return true;
case "objectmodeluri":
case "objectModelUri":
setObjectModelUri(PropertyConfigurerSupport.property(camelContext, String.class, value));
Expand Down

0 comments on commit 231e3be

Please sign in to comment.