1. cyberspyder
  2. RO CSVI
  3. Monday, 11 June 2018
  4.  Subscribe via email
I have multiple XML lines with the same name but different info in each line, however they have different attribute codes and each product has a different number of description lines. Is there a way to extract "TIMING CHAIN KIT" based on the code "[color=Red]SHO[/color]"?
Example1
<Description MaintenanceType="A" DescriptionCode="DEF" LanguageCode="EN">Engine Timing Chain Kit</Description>
<Description MaintenanceType="A" DescriptionCode="EXT" LanguageCode="EN">Timing Chain kit Contains: Camshaft Sprocket, Crankshaft Sprocket, Timing Chain, Chain Tensioner, Chain Guide.</Description>
<Description MaintenanceType="A" DescriptionCode="DES" LanguageCode="EN">Engine Timing Chain Kit</Description>
<Description MaintenanceType="A" DescriptionCode="MKT" LanguageCode="EN">All Components Meet Or Exceed O.E.M. Specifications In Manufacturing And Material.</Description>
<Description MaintenanceType="A" DescriptionCode="[color=Red]SHO[/color]" LanguageCode="EN">TIMING CHAIN KIT</Description>
Example2
<Description MaintenanceType="A" DescriptionCode="DEF" LanguageCode="EN">TRANSFER CASE DRIVE CHAIN</Description>
<Description MaintenanceType="A" DescriptionCode="DES" LanguageCode="EN">TRANSFER CASE DRIVE CHAIN</Description>
<Description MaintenanceType="A" DescriptionCode="MKT" LanguageCode="EN">Pre-Stressed And Heat-Treated For Durability. Ground Finish, Alloy Pins. Special Design For High Torque Transfer.</Description>
<Description MaintenanceType="A" DescriptionCode="[color=Red]SHO[/color]" LanguageCode="EN">TRANS. DRIVE CHAIN</Description>
Accepted Answer
Accepted Answer Pending Moderation
Hello,
You cannot extract value based on the code "SHO" but if you know the number of XML nodes before and after the node with code SHO, you can add skip field to those extra nodes and get only the SHO node value. Have a look at Import XML with same node names document which explains the use of skip field.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # Permalink


There are replies in this post but you are not allowed to view the replies from this post.