[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

parser maintains state?

  • To: xml-dev@l...
  • Subject: parser maintains state?
  • From: Wendi Sisson <wsisson@e...>
  • Date: Tue, 11 Dec 2001 11:54:07 -0600
  • Organization: FedEx Services

sisson systems
I believe my original email was sent when many people were having
problems getting XML-Dev mail, so I am re-sending. We are experiencing 2
problems with our application. One appears to be
something wrong with our XML or our parser, and the other is the
possibility that we are maintaining state when we do not want to. Any
advice, direction or similar experiences would be greatly appreciated. I
will glad to supply more detail as needed.

1. We have an unknown error in the XML. We are using Xerces J 1. The XML
appears to be valid - it can be parsed by a DOMParser and validated
against the DTD. However, we get a null pointer exception when we try to
get the length of the NodeList resulting from a getElementsByTagName
method call. This occurs with many different XML documents that are
validated by about 5 different DTDs. The code that actually throws the
exception is:

Document doc = parser.getDocument();
if (doc == null) {
    // this exception is never thrown
    throw new TradeXpressException("Doc null"); 

NodeList nlist = doc.getElementsByTagName("a");
if (nlist == null) {
    // this exception is never thrown
    throw new TradeXpressException("NodeList null"); 

try {
    int len = nlist.getLength();
} catch(Exception ex){
    // we parse the same XML document repeatedly and have no exceptions
    // then, after X number of times (sometimes as few as 8 or as many
as 100),
    //   we catch a null pointer exception here
    throw new TradeXpressException("Exception thrown: " + ex);

2. Even more frustrating than the problem above, our whole system is
hung after we encounter this error once. We instantiate a new parser
every time we parse a new XML document, so it seems to me we should not
be getting hung up unless Xerces is maintaining some kind of state. Has
anyone experienced any problems with a parser, Xerces J in particular,
maintaining a state? Our system is OK again after we cycle the VMs.

Thanks for any help,
Wendi Sisson

Wendi Sisson
Systems Programmer
International Trade Development
FedEx Services
(901) 263-6695

To unsubscribe, e-mail: xerces-j-user-unsubscribe@x...
For additional commands, e-mail: xerces-j-user-help@x...


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.