Aquí está el código siguiente extraído del manual de Primavera-WS:JDOM 2 y XPath
public class HolidayEndpoint {
private static final String NAMESPACE_URI = "http://mycompany.com/hr/schemas";
private XPath startDateExpression;
private XPath endDateExpression;
private XPath nameExpression;
private HumanResourceService humanResourceService;
@Autowired
public HolidayEndpoint(HumanResourceService humanResourceService) (2)
throws JDOMException {
this.humanResourceService = humanResourceService;
Namespace namespace = Namespace.getNamespace("hr", NAMESPACE_URI);
startDateExpression = XPath.newInstance("//hr:StartDate");
startDateExpression.addNamespace(namespace);
endDateExpression = XPath.newInstance("//hr:EndDate");
endDateExpression.addNamespace(namespace);
nameExpression = XPath.newInstance("concat(//hr:FirstName,' ',//hr:LastName)");
nameExpression.addNamespace(namespace);
}
Mi problema es que esto parece estar utilizando JDOM 1.0 y me gustaría utilizar JDOM 2.0.
¿Cómo convierto este código de JDOM 1.0 a JDOM 2.0? ¿Por qué la primavera no ha actualizado su código de muestra?
Gracias!
¿Ha actualizado las importaciones de usar jDom2? Por ejemplo, la importación para Element es 'import org.jdom2.Element;'. –