[R-es] Leyendo archivo xml

XYGcom xygcom @end|ng |rom gm@||@com
Mar Mar 23 13:02:01 CET 2021


Buenas tardes. Estoy intentando parsear un archivo xml con unos centenares de entradas cada uno ( con la estructura que pego a continuación) mediante el paquete xmlconverter. 

El script es el siguiente: test_df <- xmlconvert::xml_to_df(“/datos/data.xml”, 
                                 records.tags = "assets",
                                 no.hierarchy = "FALSE",
                                 fields = "tags”)

Pero me da este error:  Error in recs[[i]] : subscript out of bounds

La estructura de cada entrada es ésta:

<entry>
						<id>https://contrataciondelestado.es/sindicacion/datosAbiertosMenores/6960158</id>
						<link href="https://contrataciondelestado.es/wps/poc?uri=deeplink:detalle_licitacion&idEvl=LYJ5XzWBx80SugstABGr5A%3D%3D"/>
						<summary type="text">Id licitación: 2021/19; Órgano de Contratación: Gerencia de la Fundación para el Fomento de la Investigación Sanitaria y Biomédica de la Comunitat Valenciana (FISABIO); Importe: 100 EUR; Estado: RES</summary>
						<title>Servicio de secuenciación Sanger de placa de 96 pocillos</title>
						<updated>2021-01-31T14:07:34.149+01:00</updated>
						<cac-place-ext:ContractFolderStatus>
							<cbc:ContractFolderID>2021/19</cbc:ContractFolderID>
							<cbc-place-ext:ContractFolderStatusCode languageID="es" listURI="https://contrataciondelestado.es/codice/cl/2.04/SyndicationContractFolderStatusCode-2.04.gc">RES</cbc-place-ext:ContractFolderStatusCode>
							<cac-place-ext:LocatedContractingParty>
								<cbc:ContractingPartyTypeCode listURI="http://contrataciondelestado.es/codice/cl/1.04/ContractingAuthorityCode-1.04.gc">5</cbc:ContractingPartyTypeCode>
								<cac:Party>
									<cbc:WebsiteURI>http://www.fisabio.es</cbc:WebsiteURI>
									<cac:PartyIdentification>
										<cbc:ID schemeName="DIR3">A10018363</cbc:ID>
									</cac:PartyIdentification>
									<cac:PartyIdentification>
										<cbc:ID schemeName="NIF">G98073760</cbc:ID>
									</cac:PartyIdentification>
									<cac:PartyName>
										<cbc:Name>Gerencia de la Fundación para el Fomento de la Investigación Sanitaria y Biomédica de la Comunitat Valenciana (FISABIO)</cbc:Name>
									</cac:PartyName>
									<cac:PostalAddress>
										<cbc:CityName>Valencia</cbc:CityName>
										<cbc:PostalZone>46020</cbc:PostalZone>
										<cac:AddressLine>
											<cbc:Line>Avda. de Cataluña, 21 (Área Legal 2ª Planta)</cbc:Line>
										</cac:AddressLine>
										<cac:Country>
											<cbc:IdentificationCode listURI="http://docs.oasis-open.org/ubl/os-ubl-2.0/cl/gc/default/CountryIdentificationCode-2.0.gc">ES</cbc:IdentificationCode>
											<cbc:Name>España</cbc:Name>
										</cac:Country>
									</cac:PostalAddress>
									<cac:Contact>
										<cbc:Name>Gerencia de la Fundación para el Fomento de la Investigación Sanitaria y Biomédica de la Comunitat Valenciana (FISABIO)</cbc:Name>
										<cbc:Telephone>961925700</cbc:Telephone>
										<cbc:ElectronicMail>legal_fisabio using gva.es</cbc:ElectronicMail>
									</cac:Contact>
								</cac:Party>
							</cac-place-ext:LocatedContractingParty>
							<cac:ProcurementProject>
								<cbc:Name>Servicio de secuenciación Sanger de placa de 96 pocillos</cbc:Name>
								<cbc:TypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/ContractCode-2.08.gc">2</cbc:TypeCode>
								<cbc:SubTypeCode listURI="http://contrataciondelestado.es/codice/cl/1.04/ServiceContractCode-1.04.gc">27</cbc:SubTypeCode>
								<cac:BudgetAmount>
									<cbc:TotalAmount currencyID="EUR">121</cbc:TotalAmount>
									<cbc:TaxExclusiveAmount currencyID="EUR">100</cbc:TaxExclusiveAmount>
								</cac:BudgetAmount>
								<cac:RequiredCommodityClassification>
									<cbc:ItemClassificationCode listURI="http://contrataciondelestado.es/codice/cl/1.04/CPV2007-1.04.gc">73110000</cbc:ItemClassificationCode>
								</cac:RequiredCommodityClassification>
								<cac:RealizedLocation>
									<cbc:CountrySubentity>Valencia / València</cbc:CountrySubentity>
									<cbc:CountrySubentityCode listURI="http://contrataciondelestado.es/codice/cl/2.06/NUTS-2016.gc">ES523</cbc:CountrySubentityCode>
									<cac:Address>
										<cac:Country>
											<cbc:IdentificationCode listURI="http://docs.oasis-open.org/ubl/os-ubl-2.0/cl/gc/default/CountryIdentificationCode-2.0.gc">ES</cbc:IdentificationCode>
											<cbc:Name>España</cbc:Name>
										</cac:Country>
									</cac:Address>
								</cac:RealizedLocation>
								<cac:PlannedPeriod>
									<cbc:DurationMeasure unitCode="DAY">1</cbc:DurationMeasure>
								</cac:PlannedPeriod>
							</cac:ProcurementProject>
							<cac:TenderResult>
								<cbc:ResultCode listURI="http://contrataciondelestado.es/codice/cl/2.02/TenderResultCode-2.02.gc">8</cbc:ResultCode>
								<cbc:Description>Mejor precio</cbc:Description>
								<cbc:AwardDate>2021-01-08</cbc:AwardDate>
								<cbc:ReceivedTenderQuantity>1</cbc:ReceivedTenderQuantity>
								<cac:WinningParty>
									<cac:PartyIdentification>
										<cbc:ID schemeName="NIF">Q4618001D</cbc:ID>
									</cac:PartyIdentification>
									<cac:PartyName>
										<cbc:Name>UNIVERSIDAD DE VALENCIA ESTUDI GENERAL</cbc:Name>
									</cac:PartyName>
								</cac:WinningParty>
								<cac:AwardedTenderedProject>
									<cac:LegalMonetaryTotal>
										<cbc:TaxExclusiveAmount currencyID="EUR">100</cbc:TaxExclusiveAmount>
										<cbc:PayableAmount currencyID="EUR">121</cbc:PayableAmount>
									</cac:LegalMonetaryTotal>
								</cac:AwardedTenderedProject>
							</cac:TenderResult>
							<cac:TenderingProcess>
								<cbc:ProcedureCode listURI="https://contrataciondelestado.es/codice/cl/2.07/SyndicationTenderingProcessCode-2.07.gc">6</cbc:ProcedureCode>
								<cbc:UrgencyCode listURI="http://contrataciondelestado.es/codice/cl/1.04/DiligenceTypeCode-1.04.gc">1</cbc:UrgencyCode>
							</cac:TenderingProcess>
							<cac-place-ext:ValidNoticeInfo>
								<cbc-place-ext:NoticeTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.04/TenderingNoticeTypeCode-2.04.gc">DOC_CAN_ADJ</cbc-place-ext:NoticeTypeCode>
								<cac-place-ext:AdditionalPublicationStatus>
									<cbc-place-ext:PublicationMediaName>Perfil del Contratante</cbc-place-ext:PublicationMediaName>
									<cac-place-ext:AdditionalPublicationDocumentReference>
										<cbc:IssueDate>2021-01-31</cbc:IssueDate>
									</cac-place-ext:AdditionalPublicationDocumentReference>
								</cac-place-ext:AdditionalPublicationStatus>
							</cac-place-ext:ValidNoticeInfo>
						</cac-place-ext:ContractFolderStatus>
</entry>

He subido el archivo por si alguien lo necesita para ver la estructura en mayor detalle: https://we.tl/t-oao8NF3IVj

Gracias anticipadas como siempre por la ayuda.


Más información sobre la lista de distribución R-help-es