Hello Sreenivas, I am also saving the XML file using XMLSpy and able to parse it. You can send me the XML file personaly. My initial suggestion is to test whether the exception is occuring while the parse() statement or after that..
Regards, Ramana.JV. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 2003 9:13 AM To: [EMAIL PROTECTED] Subject: whitespace problem in parsing a xml file Importance: High Hi, I'm using Xerces to parse a xml file. It's able to read the xml file properly when there are no spaces in the xml file. But when I put spaces in the xml file, it's throwing the following exception. Here we'll open the xml file in xml spy and save it, it's automatically adding the spaces. so I need to parse the xml file with spaces only) java.lang.ClassCastException: org.apache.xerces.dom.DeferredTextImpl Part of parsing code is: DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); Document oDocument = docBuilder.parse (new File(strFileName)); oDocument.getDocumentElement().normalize(); NodeList nlRoot = oDocument.getElementsByTagName("XMLMapping"); NodeList nlRootChildNodes = (org.w3c.dom.NodeList)(nlRoot.item(0).getChildNodes()); Element elFormCode = (Element)nlRootChildNodes.item(0); Can anyone help me to solve this problem. This is an urgent problem for me. Thanks in advance, Sreenivas Pitchuka > Thanks and Regards, > > Sreenivas Pitchuka > Belgacom Towers - 03 P 200c > boulevard Albert II 27, 1030 Brussels > Tel: +32-2-202.73.56 > -----Original Message----- From: Mark Causer [mailto:[EMAIL PROTECTED] Sent: 14 May 2003 16:04 To: [EMAIL PROTECTED] Subject: Running Xerces1 and 2 Hi We have an existing application that uses JPOS drivers. These drivers instantiate a DOMParser to parse the config files. This code needs xerces.jar (version 1) to run. If I try using the xerces2 jars , I get a java.lang.NoClassDefFoundError: org/apache/xerces/framework/XMLParser thrown as the DOMParser's class heirachy has changed in xerces2 These drivers can not be changed. As a mod for our own app I need to use the Grammar caching in Xerces2 using DOMParser... Anyone got any suggestions how I can use Both versions of the DOMParser in the same application....... thanks Mark Causer PCMS Group PLC ________________________________________________________________________ The information contained in this e-mail is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the intended recipient of this e-mail, the use of this information or any disclosure, copying or distribution is prohibited and may be unlawful. If you received this in error, please contact the sender and delete the material from any computer. The views expressed in this e-mail may not necessarily be the views of The PCMS Group plc and should not be taken as authority to carry out any instruction contained. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] **** DISCLAIMER **** "This e-mail and any attachments thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by persons other than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer. Thank you for your cooperation." --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] **************************************************************************** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. **************************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
