This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
hi all! iam creating an xml file by reading a simple text file which contains member details like name,address and some payment details. Using schema validations iam validating this xml file with some 10 rules. suppose if the parser throws some error while checking the rules iam writing the errors in to the errorlog.txt file. Is it is possible to get the data's from the xml file only from the point at which the error occured.Becuase I want to log into the errorlog.txt file only the datas from which the error occured to the end of the file. If possible Can I know how it is possible. It is required uregently. Thanks and Regards prathibha
I am assuming, you always validate the "current node". If you're using a SAX parser, you can get the reference to the current element using the Locator. It also has several useful methods such as getLineNumber(), getColumnNumber() etc. The only drawback withusing a SAX parser is that you cannot "look back" or "peek ahead" of the current element, if you need for example, to get the handle to the parent node of the current element. Many sample examples that come with either Xerces or JAXP download contain typical locator usage. If you are using a DOM parser, you can get the current Node. This will be the current context that you are interested in. DOM has the ultimate flexibility in navigating the document hierarchy and so you don't have to confront the limited visibility problems. Does that answer your question? ------------------ Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform. IBM Certified Developer - XML and Related Technologies, V1.
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).