Loading ...
Sorry, an error occurred while loading the content.

5701Xpath help required

Expand Messages
  • Sean Kilmurray
    Nov 13, 2006
      Xpath help required Hi,

      I'm very new to SOAP Lite but I managed to get a Perl client up and running that queries a .Net service hosted by the company I work for. I can make basic xpath queries such as:

      $theProdUPC = $BOM_Data_XML->valueof('//Authenticated_GetBOMDataByCPRSProductIDResult/ProductUPC');
      $theArtist = $BOM_Data_XML->valueof('//Authenticated_GetBOMDataByCPRSProductIDResult/CPRSArtist');
      $theTitle = $BOM_Data_XML->valueof('//Authenticated_GetBOMDataByCPRSProductIDResult/CPRSTitle');

      Now the problem is that the XML information that is returned is a not very consistent due to the bad data model of our web service. Fixing it is not an option at the moment so I’ve managed to come up with an Xpath query using Xpath Visualiser that will locate the nodes I’m interested in. This is the query:


      I’m hoping to pass the result of this query to an array and then do some further processing within Perl using this line of code:

      my @BOM_Item_List = $BOM_Data_XML->valueof('//Authenticated_GetBOMDataByCPRSProductIDResponse/Authenticated_GetBOMDataByCPRSProductIDResult/BillOfMaterials/descendant::BOMItem[not(child::Items)]/BOMItemID/text()');

      print "@BOM_Item_List \n";

      As I can’t seem to get a result I’m wondering if this query is too complicated for SOAP lite to process and if I would need to use come other Perl module?

      Any help or tips is most appreciated