Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Hello World in Groovy */
- def text = '''
- <root>
- <row>
- <BusinessPartner>9980000000</BusinessPartner>
- <BPIdentificationType>HCM001</BPIdentificationType>
- <BPIdentificationNumber>RF000001</BPIdentificationNumber>
- <BPIdnNmbrIssuingInstitute></BPIdnNmbrIssuingInstitute>
- <BPIdentificationEntryDate></BPIdentificationEntryDate>
- <Country></Country>
- <Region></Region>
- <ValidityStartDate></ValidityStartDate>
- <ValidityEndDate>31-12-99 00:00</ValidityEndDate>
- <AuthorizationGroup></AuthorizationGroup>
- </row>
- <row>
- <BusinessPartner>9980000001</BusinessPartner>
- <BPIdentificationType>HCM001</BPIdentificationType>
- <BPIdentificationNumber>R000001</BPIdentificationNumber>
- <BPIdnNmbrIssuingInstitute></BPIdnNmbrIssuingInstitute>
- <BPIdentificationEntryDate></BPIdentificationEntryDate>
- <Country></Country>
- <Region></Region>
- <ValidityStartDate></ValidityStartDate>
- <ValidityEndDate>31-12-99 00:00</ValidityEndDate>
- <AuthorizationGroup></AuthorizationGroup>
- </row>
- <row>
- <BusinessPartner>9980000003</BusinessPartner>
- <BPIdentificationType>HCM001</BPIdentificationType>
- <BPIdentificationNumber>R000002</BPIdentificationNumber>
- <BPIdnNmbrIssuingInstitute></BPIdnNmbrIssuingInstitute>
- <BPIdentificationEntryDate></BPIdentificationEntryDate>
- <Country></Country>
- <Region></Region>
- <ValidityStartDate></ValidityStartDate>
- <ValidityEndDate></ValidityEndDate>
- <AuthorizationGroup></AuthorizationGroup>
- </row>
- <row>
- <BusinessPartner>9980001106</BusinessPartner>
- <BPIdentificationType>HCM001</BPIdentificationType>
- <BPIdentificationNumber>620</BPIdentificationNumber>
- <BPIdnNmbrIssuingInstitute></BPIdnNmbrIssuingInstitute>
- <BPIdentificationEntryDate></BPIdentificationEntryDate>
- <Country></Country>
- <Region></Region>
- <ValidityStartDate></ValidityStartDate>
- <ValidityEndDate></ValidityEndDate>
- <AuthorizationGroup></AuthorizationGroup>
- </row>
- <row>
- <BusinessPartner>1000428</BusinessPartner>
- <BPIdentificationType>BUP002</BPIdentificationType>
- <BPIdentificationNumber>000785678</BPIdentificationNumber>
- <BPIdnNmbrIssuingInstitute>Cenas</BPIdnNmbrIssuingInstitute>
- <BPIdentificationEntryDate></BPIdentificationEntryDate>
- <Country></Country>
- <Region></Region>
- <ValidityStartDate>13-11-19 00:00</ValidityStartDate>
- <ValidityEndDate>23-11-23 00:00</ValidityEndDate>
- <AuthorizationGroup></AuthorizationGroup>
- </row>
- <row>
- <BusinessPartner>9980001120</BusinessPartner>
- <BPIdentificationType>HCM001</BPIdentificationType>
- <BPIdentificationNumber>627</BPIdentificationNumber>
- <BPIdnNmbrIssuingInstitute></BPIdnNmbrIssuingInstitute>
- <BPIdentificationEntryDate></BPIdentificationEntryDate>
- <Country></Country>
- <Region></Region>
- <ValidityStartDate></ValidityStartDate>
- <ValidityEndDate></ValidityEndDate>
- <AuthorizationGroup></AuthorizationGroup>
- </row>
- <row>
- <BusinessPartner>9980001122</BusinessPartner>
- <BPIdentificationType>HCM001</BPIdentificationType>
- <BPIdentificationNumber>622</BPIdentificationNumber>
- <BPIdnNmbrIssuingInstitute></BPIdnNmbrIssuingInstitute>
- <BPIdentificationEntryDate></BPIdentificationEntryDate>
- <Country></Country>
- <Region></Region>
- <ValidityStartDate></ValidityStartDate>
- <ValidityEndDate></ValidityEndDate>
- <AuthorizationGroup></AuthorizationGroup>
- </row>
- </root>
- '''
- def test_list = []
- def list = new XmlParser().parseText(text);
- def row = list.children().find { node -> node.BusinessPartner.text() == "9980001120" }
- test_list.add(list.row[3])
- println(test_list)
- println(row)
- println(row.BusinessPartner.text())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement