Skip to content
Prev 392356 / 398502 Next

Parsing XML?

On Wed, 27 Jul 2022 15:50:55 -0500
Spencer Graves <spencer.graves at effectivedefense.org> wrote:

            
Isn't XMLdat already a tree-like list? For example,
XMLdat[[1]][[1]][[3]][[1]] is the first <record> tag in the file, which
you can further pick apart.

What information do you need from this file and how would you like to
access it? Parsing XML files is typically achieved with XPath
expressions (e.g. 'under every <record> tag, extract the <datafield>
tags containing attribute tag="042"' would look like
'record/datafield[tag="042"]') and/or handlers on specific tags, not by
extracting all text nodes and performing string operations on them.