Forum Discussion
PaulDonny
12 years agoRegular Contributor
DatSupport wrote: Hi Guys,
thank you for your response. I tried both of your proposals. While the first proposal of mrao only returned exactly one match, the proposal of PaulM was, referring to the result, a bit like my own ones, because there are enclosing <equipment> tags around the inner single <epuipment> tags (see below the red ones).
<equipment><equipment>26803</equipment><equipment>40000</equipment><equipment>70303</equipment><equipment>29500</equipment><equipment>18904</equipment><equipment>22202</equipment><equipment>97000</equipment><equipment>10004</equipment><equipment>75205</equipment></equipment>
The problem is, that I don't need to have the outer enclosing equipment tags. I only want to have each value enclosed by an equipment tag. But every time I just try to leave off the outer equipment I get a java.lang.reflect.InvocationTargetException. It's not possible to have the following code working:for $b in //ns3:EquipmentPosition
return( /*here I left out the <equipment> tag */
{
let $y := //ns3:DatEquipmentId[$b]
for $avtext in $y
return (<equipment>{data($avtext)}</equipment>)
}
/* I left out the </equipment> tag, too */)
What do I have to do to get only the inner equipment tags working?
I hope you understand that problem.
Regards,
H
Mine doesn't include the outer equipment tags so I would presume it is being caused by where you are putting the transfer (or getting the data from). I used, essentially, what you had posted above within SoapUI to do the transfer and here is my result:
<soapenv:Body><equipment>26803</equipment><equipment>40000</equipment><equipment>18603</equipment><equipment>97000</equipment></soapenv:Body>
That is with the request:
<ns3:Equipment>
<ns3:SeriesEquipment>
<ns3:EquipmentPosition>
<ns3:DatEquipmentId>26803</ns3:DatEquipmentId>
<ns3:ManufacturerEquipmentId>4UE</ns3:ManufacturerEquipmentId>
<ns3:Description>Airbag Fahrer-/Beifahrerseite</ns3:Description>
<ns3:EquipmentGroup>AIR1</ns3:EquipmentGroup>
</ns3:EquipmentPosition>
<ns3:EquipmentPosition>
<ns3:DatEquipmentId>40000</ns3:DatEquipmentId>
<ns3:Description>Anti-Blockier-System (ABS)</ns3:Description>
<ns3:EquipmentGroup>ABS</ns3:EquipmentGroup>
</ns3:EquipmentPosition>
</ns3:SeriesEquipment>
<ns3:SpecialEquipment>
<ns3:EquipmentPosition>
<ns3:DatEquipmentId>18603</ns3:DatEquipmentId>
<ns3:ManufacturerEquipmentId>8Q5</ns3:ManufacturerEquipmentId>
<ns3:Description>Xenon-Scheinwerfer Plus adaptive light (Abbiegelicht integriert)</ns3:Description>
<ns3:EquipmentGroup>BXEL</ns3:EquipmentGroup>
</ns3:EquipmentPosition>
</ns3:SpecialEquipment>
<ns3:DATECodeEquipment>
<ns3:EquipmentPosition>
<ns3:DatEquipmentId>97000</ns3:DatEquipmentId>
<ns3:Description>Motor 2,0 Ltr. - 103 kW TDI</ns3:Description>
</ns3:EquipmentPosition>
</ns3:DATECodeEquipment>
</ns3:Equipment>
In your Target are you possibly putting it into an equipment tag? If so, go to the parent.