|
From: <pe...@us...> - 2004-01-14 16:34:30
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml In directory sc8-pr-cvs1:/tmp/cvs-serv7171/src/java/org/neuclear/xml Modified Files: XMLTools.java Log Message: New model of references and signatures now pretty much works. I am still not 100% sure on the created enveloping signatures. I need to do more testing. Index: XMLTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/XMLTools.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** XMLTools.java 13 Jan 2004 23:37:59 -0000 1.5 --- XMLTools.java 14 Jan 2004 16:34:27 -0000 1.6 *************** *** 2,5 **** --- 2,9 ---- * $Id$ * $Log$ + * Revision 1.6 2004/01/14 16:34:27 pelle + * New model of references and signatures now pretty much works. + * I am still not 100% sure on the created enveloping signatures. I need to do more testing. + * * Revision 1.5 2004/01/13 23:37:59 pelle * Refactoring parts of the core of XMLSignature. There shouldnt be any real API changes. *************** *** 141,148 **** */ ! import org.dom4j.Document; ! import org.dom4j.DocumentException; ! import org.dom4j.DocumentHelper; ! import org.dom4j.Element; import org.dom4j.dom.DOMDocument; import org.dom4j.io.*; --- 145,149 ---- */ ! import org.dom4j.*; import org.dom4j.dom.DOMDocument; import org.dom4j.io.*; *************** *** 297,301 **** throw new XMLException(e); } ! } --- 298,327 ---- throw new XMLException(e); } ! /** ! * This is used to find an Elemente with a given ID. ! * This is necessary because of Dom4j's use of the ID attribute ! * and not the more common in XMLSignature Id attribute. ! * @param elem ! * @param id ! * @return ! */ ! public static Element getByID(Element elem,String id){ ! return getByID(elem.getDocument(),id); ! } ! /** ! * This is used to find an Elemente with a given ID. ! * This is necessary because of Dom4j's use of the ID attribute ! * and not the more common in XMLSignature Id attribute. ! * @param doc ! * @param id ! * @return ! */ ! public static Element getByID(Document doc,String id){ ! Element object=doc.elementByID(id); ! if (object!=null) ! return object; ! XPath xp=DocumentHelper.createXPath("//*[@Id='"+id+"']"); ! return (Element) xp.selectSingleNode(doc); ! } } |