xml-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41256] New: - NullPointer Exception in at org.apache.xml.utils.TreeWalker.dispatachChars
Date Fri, 29 Dec 2006 09:38:44 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41256>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41256

           Summary: NullPointer Exception in  at
                    org.apache.xml.utils.TreeWalker.dispatachChars
           Product: XmlCommons
           Version: 1.x
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DOM
        AssignedTo: commons-dev@xml.apache.org
        ReportedBy: sohankumar.soni@sos.sungard.com


I am not sure whether I reported this bug under right component, so please 
guide me to the correct one, if I am wrong.
Bug is like this.



I am getting this error while running my application.
I really dont have any clue why this is happening?

Can somebody please help me, as I really can not proceed with my application?
Here is the code which I am using for creating doc from string and creating 
string from doc.



public static Document getDocFromString(String xmlString){

      Document doc = null;
         try
      {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         DocumentBuilder db = dbf.newDocumentBuilder();
         doc = db.parse(new InputSource(new StringReader(xmlString)));

      }
      catch( Exception Ex ){
             Ex.printStackTrace();
         try {
            throw Ex;
         } catch (Exception ef) {}
      }

      return doc;
   }

   // convert a Document Object to a String
   public static String documentToString(Document pDoc) {

      StringWriter sw = new StringWriter();
      try {
         TransformerFactory tFactory = TransformerFactory.newInstance();
         Transformer transformer = tFactory.newTransformer();
         transformer.transform(new DOMSource(pDoc), new StreamResult(sw));
      } catch (Exception e) {
         e.printStackTrace();
         try {
            throw e;
         } catch (Exception ef) {}
      }

      return sw.toString();
   }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message