Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..
1171 views

Working XPath Query Example ??

Does anyone have a working xPath Query example ?  Annoyingly, using the exact example in the XPath Query step Description tab doesn't work ... go figure.

 

Using this XML doc:

 

<?xml version="1.0" encoding="UTF-8"?>
<employees>
<employee id="1">
<name>Mickey Mouse</name>
<jobDescription>Chief</jobDescription>
<salary>$100</salary>
<managerId/>
</employee>
<employee id="2">
<name>Donald Duck</name>
<jobDescription>Lead Coder</jobDescription>
<salary>$50</salary>
<managerId>1</managerId>
</employee>
<employee id="3">
<name>Goofy</name>
<jobDescription>tester</jobDescription>
<salary>$50</salary>
<managerId>1</managerId>
</employee>
<employee id="4">
<name>Pluto</name>
<jobDescription>Coder - grade 1</jobDescription>
<salary>$25</salary>
<managerId>2</managerId>
</employee>
</employees>

 

With this xpathQuery:

 

/employees/employee[@id="3"]/*[name()="name" or name()="jobDescription" or name()="salary" or name()="managerId"]/text()

 

The above from the description is supposed to produce this:

 

Goofy,tester,$50,1

 

I get this:

 

{FailureMessage=AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.rmi.RemoteException: execute failed for JRASRepository.jar:com/iconclude/content/actions/xml/XPathQuery.class; nested exception is:
java.lang.RuntimeException: error instantiating action class: JRASRepository.jar/com/iconclude/content/actions/xml/XPathQuery.class, reason: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:aoxz1146

java.rmi.RemoteException: execute failed for JRASRepository.jar:com/iconclude/content/actions/xml/XPathQuery.class; nested exception is:
java.lang.RuntimeException: error instantiating action class: JRASRepository.jar/com/iconclude/content/actions/xml/XPathQuery.class, reason: java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)

<snip>

Labels (1)
0 Likes
4 Replies
Absent Member.. ntt00015 Absent Member..
Absent Member..

Re: Working XPath Query Example ??

Hi,

 

I ve dealed with XPATHs. I determined some bugs about XML operations and opened cases for them. For your example,  are you trying to use XPATH Query operation or XPATH filter under the result filters in any operation?

 

What are the versions of OO Central, RAS and Studios? While we applying content patches, despite we thought we applied patches successfully, after patches we got some errors like these. So we re-installed patches again. 

 

Now we are using OO application version: 9.02 patch(9.00.02) and installed content patches are all including (9.00.06)

 

I guess you should re-install 9.00.05 and 9.00.06 content patches again. Be sure you've installed according to the installation guide.

 

And lastly check out the HP Support Site and search in the self-solve for your error. You might find something there.

 

Regards.

 

0 Likes
Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..

Re: Working XPath Query Example ??

Hey,

 

Thanks for the reply.   Annoyingly it ended up being a content patch that didn't install fully.  Someone else tried reapplying it and the xPath Query step started working correctly ... go figure.

 

I did discover that the xPath Query result filter expects to be a hard coded string and can't contain OO flow variables in it.  This is rather annoying in situations where where you want to use the xPath Query as a result filter but make the filter dynamic basic on other flow variables helping to build out the xpath query.

0 Likes
Absent Member.. ntt00015 Absent Member..
Absent Member..

Re: Working XPath Query Example ??

I am happy that reapplying patch solved your problem.

 

I ve opened change request for that filter problem. I think it will be solved in the new content patch. Because this flows are filling with unnecessary steps. Until the patch you have to use some workarounds.

0 Likes
g-mitchell Absent Member.
Absent Member.

Re: Working XPath Query Example ??

Hi - I have a similar issues on 9.00 with XPATH-Extract. 

 

Are we saying that upgrading to 9.02 fixes this and the reliability of the XPATH and XML handling routines ?

 

Regards

Graham 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.