标签云

微信群

扫码加入我们

WeChat QR Code

<?xml version="1.0"?><mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><database name="test"><table_data name="test"><row><field name="field1">406</field><field name="field2">a2</field><field name="field3">16</field><field name="field4"></field><field name="field5" xsi:type="xs:hexBinary">[get the content from http://122.183.130.242/file/hex.txt path because i cannot give such a large content to stackoverflow]</field><field name="field6">16</field></row></table_data></database></mysqldump>I am trying to parse and read the content from the above xml file.I am using a DOM parser and I also tried StAX parser to parse the XML but I cannot parse such a large file.How can I parse large XML files?


DOM is not a good option for such a large files. If SAX also failing only option you have I think will be increase memory.

2019年04月18日31分19秒

ya, that is why am asking friend. what will be the better approach for this one.

2019年04月18日31分19秒

what error are you getting when you try to parse?

2019年04月19日31分19秒

am did not get any error. but file parsing is skipped.

2019年04月18日31分19秒

"file parsing is skipped" says that the parser isn't the problem, something else in your code is. If it were truly a problem of the file being too big, you'd get an OutOfMemoryError. To get better answers, post your code.

2019年04月19日31分19秒

i have a question, does this SAX parser will allow to change and update the xml content?

2019年04月19日31分19秒