Page 1 of 1

XPATH expression TextIndexed

Posted: Fri Feb 27, 2026 11:55 am
by JuBaz
Hi all,
I have a xml file with multiple order positions which may be send to the customer from different locations. I now want to know, whats the weight of the packages, but just for the positions which will be send out from the shipping location = luc_inhouse and not for the others. I've already tried something like this //position[./productShippingLocation = luc_inhouse]/weight but I didn't get any result.

xml structur see below.

Thanks in advance and regards, Julia

</position>
<position>
<netPrice>2.900</netPrice>
<grossPrice/>
<vat>19.0</vat>
<amount>2</amount>
<totalQuantity>2</totalQuantity>
<productShippingLocation>b7</productShippingLocation>
<product>
<internalId>172822</internalId>
<externalId>GMC-GA-10000227-10</externalId>
<productName>Einkaufswagenlöser</productName>
<productDescription>aus Metall incl. angebrachtem Schlüsselring </productDescription>
<packingUnit>T_PCS</packingUnit>
<packingQuantity>1</packingQuantity>
<weight>12</weight>
<productCatalog></productCatalog>
<productCategory>stock</productCategory>
<propertyFormat>6,5 x 2,5 cm </propertyFormat>
<propertyCoverage/>
<propertyPrint/>
<propertyConditioning/>
<propertyPaper/>
<propertyProcessing/>
</product>
</position>
</position>
<position>
<netPrice>4.750</netPrice>
<grossPrice/>
<vat>19.0</vat>
<amount>1</amount>
<totalQuantity>1</totalQuantity>
<productShippingLocation>luc_inhouse</productShippingLocation>
<product>
<internalId>9876</internalId>
<externalId>5432</externalId>
<productName>Schild</productName>
<productDescription>Name</productDescription>
<packingUnit>T_PCS</packingUnit>
<packingQuantity>1</packingQuantity>
<weight>25</weight>
<productCatalog>Namensschild</productCatalog>
<productCategory>vdp</productCategory>
<propertyFormat>6,5 x 3,5 cm</propertyFormat>
<propertyCoverage>2-seitig</propertyCoverage>
<propertyPrint>Lasergravur</propertyPrint>
<propertyConditioning/>
<propertyPaper>Aluminium</propertyPaper>
<propertyProcessing>Verpacken, magentischen Clip hinzufügen</propertyProcessing>
</product>
</position>

Re: XPATH expression TextIndexed

Posted: Fri Feb 27, 2026 12:26 pm
by mkayyyy
Your XPath expression should be this:

Code: Select all

//position[productShippingLocation='luc_inhouse']/product/weight
It was missing quotes around 'luc_inhouse' and /product/weight

Re: XPATH expression TextIndexed

Posted: Fri Feb 27, 2026 12:40 pm
by JuBaz
Sometimes it's that easy, thank you!

Re: XPATH expression TextIndexed

Posted: Fri Feb 27, 2026 12:43 pm
by mkayyyy
No worries! Glad I could help