performance - What is the fastest way to remove nodes from a large XML file using .net -
i working working large xml files (100s of mbs). tree simple
<items> <item> <column1>abc</column1> <column2>def</column2> </item> <item> <column1>ghi</column1> <column2>klm</column2> </item> </items>
i need parse document, , remove <item>
elements. far, best peerformance achieved using xmlreader, caching each <item>
in memory , writing using xmlwriter out if meets criteria, , ignoring if doesn't. there anyting can make faster?
you might able save step implementing subclass of xmlreader read
method skips on item
elements you're not interested in. right now, seem have 2 steps: reading , filtering document xmlreader
, using xmlwriter
write presumably read from. subclassing xmlreader
eliminates second step; use subclassed xmlreader
input xslt transform or xmldocument
or whatever, , never builds intermediate representation of filtered xml document.
Comments
Post a Comment