You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by di...@apache.org on 2006/11/06 17:06:39 UTC

svn commit: r471775 - /xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java

Author: dims
Date: Mon Nov  6 08:06:38 2006
New Revision: 471775

URL: http://svn.apache.org/viewvc?view=rev&rev=471775
Log:
undoing change committed in r470407

Modified:
    xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java

Modified: xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java?view=diff&rev=471775&r1=471774&r2=471775
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java Mon Nov  6 08:06:38 2006
@@ -1939,7 +1939,14 @@
 			String fragment = sb.toString();
 
             try {
-                Document d = parseFragment(fragment);
+                DocumentBuilderFactory dbf =
+                    DocumentBuilderFactory.newInstance();
+				dbf.setNamespaceAware(true);
+				dbf.setAttribute("http://xml.org/sax/features/namespaces", Boolean.TRUE);
+				DocumentBuilder db = dbf.newDocumentBuilder();
+				Document d = db.parse(
+				    new InputSource(new StringReader(fragment)));
+
 				Element fragElt = (Element) _contextDocument.importNode(
 						 d.getDocumentElement(), true);
 				result = _contextDocument.createDocumentFragment();
@@ -1949,6 +1956,8 @@
 					result.appendChild(child);
 					child = fragElt.getFirstChild();
 				}
+				// String outp = serialize(d);
+
             } catch (SAXException se) {
                 throw new XMLEncryptionException("empty", se);
             } catch (ParserConfigurationException pce) {
@@ -1958,17 +1967,6 @@
             }
 
             return (result);
-        }
-
-        protected Document parseFragment(String fragment) throws ParserConfigurationException, SAXException, IOException {
-            DocumentBuilderFactory dbf =
-                DocumentBuilderFactory.newInstance();
-            dbf.setNamespaceAware(true);
-            dbf.setAttribute("http://xml.org/sax/features/namespaces", Boolean.TRUE);
-            DocumentBuilder db = dbf.newDocumentBuilder();
-            Document d = db.parse(
-                new InputSource(new StringReader(fragment)));
-            return d;
         }
     }