How to Canonicalize a Stax XML object.
Posted
by Enrique San Martín
on Stack Overflow
See other posts from Stack Overflow
or by Enrique San Martín
Published on 2010-05-05T13:43:51Z
Indexed on
2010/05/05
13:48 UTC
Read the original article
Hit count: 374
Hello, i want to Canonicalize a Stax object, the program it's doing it with DOM, but dom can't manage big XML documents (like 1GB), so STAX it's the solution.
The Code 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 :)
© Stack Overflow or respective owner