Forum Discussion

ad1's avatar
ad1
New Contributor
8 years ago

Property transfer of value x where other value is y

Hello,

 

I have the following response:

..

<a:StructureNode>
<a:StructureId>19d6c2dd-e8ae-4481-a293-db3bbc8092fe</a:StructureId>
<a:Name>Ebooks</a:Name>
..
</a:StructureNode>

 

I want to transfer the StructureId to a property. In the property transfer the xpath looks like this:

declare namespace ns1='...';
declare namespace a='..';
//ns1:GetStructureNodesByStructureIdResponse[1]/ns1:Structure[1]/a:ChildItems[1]/a:StructureNode[2]/a:StructureId[1]

 

Since this structurenode doesn't have a fixed position (not always nr 2) what I want to say in the xpath is get the structureid where the name in the structurenode is Ebooks

 

I tried it like this:

declare namespace ns1='...';
declare namespace a='..';
//ns1:GetStructureNodesByStructureIdResponse[1]/ns1:Structure[1]/a:ChildItems[1]/a:StructureNode/text()='Ebooks'/a:StructureId[1]

 

However, this return null. 

 

Any idea how this can be done?