I'm trying to extract data from an xml file. I'm extracting the nodes separately with the following code:
entity_uin <- xml_text(xml_find_all(xml, ".//Entity/EntityUin"))
entity_name <- xml_text(xml_find_all(xml, ".//Entity/EntityName"))
entity_zip_code <- xml_text(xml_find_all(xml, ".//Entity/EntityZipCode"))
This way I'm getting three character vectors. Then, I'm trying to create a tibble from these character vectors with the following code:
xml <- tibble(entity_uin, entity_name, entity_zip_code)
Unfortunately, this doesn't work because the three character vectors are with unequal lengths. Can anyone suggest a solution?
xmlis a document fromread_xml()or a node(set) fromxml_find_all()/xml_find_first(). Or if there are some subnodes missing in someEntitynodes or are you dealing with some kind of deeper structure (e.g. nested entities) or something else.