Can xmlstarlet deal with this large xml file?
http://download.wikipedia.com/zh_yuewiki/20150702/zh_yuewiki-20150702-pages-articles.xml.bz2
This command works:
xmlstarlet sel -t -c '/' zh_yuewiki-20150702-pages-meta-current.xml >output.xml
This fails:
xmlstarlet sel -t -c '//title' zh_yuewiki-20150702-pages-meta-current.xml >output.xml
When you say "fails", what happens exactly?
The
sel
command basically runs some XSLT on the input. You can see the XSLT code withxmlstarlet sel -C -t ...
. You could use this same XSLT with some other engine that deals better with large files.It crash without printing anything. The exit code is 1.
That's a pitty. Anyway, thanks for providing the solution.