Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with XPATH expression

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could someone please help find the right xpath expression to get the needed node.

I'm trying to get the //parameterValues/item[name='Group']/item/use

I've setup a prefix for the namespace and my matching is working fine on simple queries...this one I'm just messing up the syntax or something.

Essentially I'm trying to get the value: 324980

Here's the XML:

<?xml version="1.0" encoding="utf-8" ?>
- <!--
Copyright (C) 2004 Cognos Incorporated. All Rights Reserved.
Cognos (R) is a trademark of Cognos Incorporated.


-->
- <!--
Experimental.
Product features described in this file may not be supported in future releases.


-->
- <outputDescriptor xmlns="http://developer.cognos.com/schema/OutputDescriptor/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://developer.cognos.com/schema/OutputDescriptor/1.0/OutputDescriptor.xsd">
<asOfTime>2005-03-28T14:25:46.702Z</asOfTime>
<burstKey>CENTENE MANAGEMENT (324980)</burstKey>
<contact />
<defaultDescription />
<defaultName>2005-03-28T14:45:20.075Z</defaultName>
<fileName>511_1112042720076.pdf</fileName>
<locale>en-us</locale>
<owner>SCHLOSA</owner>
<ownerNamespace>ADS</ownerNamespace>
- <parameterValues>
- <item>
<name>Group</name>
- <value>
- <item xsi:type="simpleParmValueItem">
<inclusive>1</inclusive>
<display>324980</display>
<B><use>324980</use></B>
</item>
</value>
</item>
- <item>
<name>StartDate</name>
- <value>
- <item xsi:type="simpleParmValueItem">
<inclusive>1</inclusive>
<display>Jun 1 2004</display>
<use>2004-06-01T00:00:00.000</use>
</item>
</value>
</item>
- <item>
<name>Months</name>
- <value>
- <item xsi:type="simpleParmValueItem">
<inclusive>1</inclusive>
<display>9</display>
<use>9</use>
</item>
</value>
</item>
</parameterValues>
<reportSearchPath>/content/package[@name='Client Reporting - New']/report[@name='Client Report Card']</reportSearchPath>
<reportViewSearchPath>/content/folder[@name='Large Client Report Views - Parent']/reportView[@name='Report View of Client Report Card']</reportViewSearchPath>
</outputDescriptor>

Thanks for the help.
 
Jay Allen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just figured it out. I needed to use my namespace in the brackets.

//prefix arameterValues/prefix:item[prefix:name='Group']/prefix:value/prefix:item/prefix:use

Hope this helps someone in the future...
 
I will suppress my every urge. But not this shameless plug:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic