0

How to specify elements wrapped in a variable parent

I'm building an open data table and I'd like to test it with some more complicated test queries. However, the responses uses a variable name for each node instead of a generic "item".
Here's sample data. I would like to return the legal_basis for each item to be cross referenced with another table. However, the parent node is not consistent.

How would you grab only the legal_basis value for each node? What if there could be more than one for each document?

Thanks

<results>
<json>
<_40513>
<form>Agreement</form>
<api_url>http://api.epdb.eu/eurlex/document/?id=140513</api_url>
<eurlex_perma_url>http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:21983A0330(02):EN:NOT</eurlex_perma_url>
<doc_id>140513</doc_id>
<date_document>1983-03-28</date_document>
<of_effect>1984-02-01</of_effect>
<end_validity>1986-12-31</end_validity>
<oj_date>1983-03-30</oj_date>
<directory_codes>
<directory_code>07.40.30.00</directory_code>
</directory_codes>
<directory_codes>
<directory_code>11.10.00.00</directory_code>
</directory_codes>
<directory_codes>
<directory_code>13.20.20.00</directory_code>
</directory_codes>
<legal_basis>
<legal_basis>11957E</legal_basis>
</legal_basis>
</_40513>
<_42807>
<form>Agreement</form>
<api_url>http://api.epdb.eu/eurlex/document/?id=142807</api_url>
<eurlex_perma_url>http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:21998A0710(01):EN:NOT</eurlex_perma_url>
<doc_id>142807</doc_id>
<date_document>1998-06-18</date_document>
<of_effect>1998-06-18</of_effect>
<end_validity>2100-01-01</end_validity>
<oj_date>1998-07-10</oj_date>
<directory_codes>
<directory_code>07.20.40.10</directory_code>
</directory_codes>
<directory_codes>
<directory_code>07.30.30.00</directory_code>
</directory_codes>
<directory_codes>
<directory_code>07.40.30.00</directory_code>
</directory_codes>
<legal_basis>
<legal_basis>11992E075 -P1 ADOPTION</legal_basis>
</legal_basis>
<legal_basis>
<legal_basis>11992E084 -P2 ADOPTION</legal_basis>
</legal_basis>
<legal_basis>
<legal_basis>11992E130M</legal_basis>
</legal_basis>
<legal_basis>
<legal_basis>11992E228 -P2F1 ADOPTION</legal_basis>
</legal_basis>
<legal_basis>
<legal_basis>11992E228 -P3L1 ADOPTION</legal_basis>
</legal_basis>
<legal_basis>
<legal_basis>11992E228 -P4 ADOPTION</legal_basis>
</legal_basis>
</_42807>
</json>
</results>

by
0 Replies

Recent Posts

in YQL