Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Canonicalize an Big XML?

843834May 5 2010 — edited May 7 2010
Hello, i want to Canonicalize a big XML (like 1GB or more), the program it's in DOM, but dom can't manage big XML documents, so i was thinking to do it with STAX. How i can do it?

The Code (with dom) that i have it's:

File file=new File("big-1gb.xml");

org.apache.xml.security.Init.init();
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = dfactory.newDocumentBuilder();

Document doc = documentBuilder.parse(file);

Canonicalizer c14n = Canonicalizer.getInstance("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");

outputBytes = c14n.canonicalizeSubtree(doc.getElementsByTagName("SomeTag").item(0));

The idea it's do the code below with Stax...

Thx :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2010
Added on May 5 2010
11 comments
1,073 views