-1

I want to get the snapshotID according to the indicated snapshotName from the below xml file, that is to say, get the sibling node of snapshotName. the snapshotName is known and unique for each exposedItemList. Is there any methods in scala to implement the requirement? thanks.

<exposedItemsList>
 <ID>2015.118</ID>
 <type>process</type>
 <itemID>25.aa5237d4-13a6-4dd0-8239-b16a904b74ed</itemID>
 <itemReference>79df5ca8-8d4d-46f1-b225-da1cd9743486/25.aa5237d4-13a6-4dd0-8239-b16a904b74ed</itemReference>
 <processAppID>2066.7fa626cf-2bfb-4e11-b3f5-53a3d46d4084</processAppID>           
 <processAppName>Credit Card Dispute</processAppName>
 <processAppAcronym>CCD</processAppAcronym>
 <snapshotID>2064.fc8a4810-8b06-44cc-ba6c-18e8f0de1058</snapshotID>  

 <snapshotName>Create_stressadmin_4_For_Deploy</snapshotName>  

 <snapshotCreatedOn>2014-08-26T00:59:38Z</snapshotCreatedOn>
 <display>EstimateProperty</display>
 <tip>true</tip>
 <branchID>2063.84215af3-dbba-4ae3-9137-fe05142c05b8</branchID>
 <branchName>Main</branchName>
 <startURL>/rest/bpm/wle/v1/process?action=start&bpdId=25.aa5237d4-13a6-4dd0-8239-b16a904b74ed&processAppId=2066.7fa626cf-2bfb-4e11-b3f5-53a3d46d4084</startURL>
 <isDefault>false</isDefault>
</exposedItemsList>
michael
  • 1
  • 1

1 Answers1

0

The below code could fulfill the goal. feedXml is a scala.xml.Elem

val res = (feedXml\\"exposedItemsList").filter(_.child.exists(_.text.equals("Create_stressadmin_4_For_Deploy")))
pheeleeppoo
  • 1,491
  • 6
  • 25
  • 29
michael
  • 1
  • 1