Hi all.

I have string contains xml content. I use dom xml parser. Below is my parse code.

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc=builder.parse(new InputSource(new StringReader(xmlText)));

It works but very slow. too slow. If i write xml to file and parse from file like builder.parse(filePath) then
working time is around 100ms. If i parse from string working time around 7 second.

How can i fix my problem

write to a temp file?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.