Re: [dom4j-dev] Writing some additions to dom4j

2003-12-10 Thread David Thielen
Hi; Yes. For the file encoding, I want to return the value 'utf-8' in the line. For the existence, I want to write something mode efficient than return Node.selectNodes("xpath_statement").size() > 0; I am assuming I can use the code for selectNodes() but drop out early as soon as I find a no

[dom4j-dev] Iterator.remove() on elements

2003-12-10 Thread David Frankson
I am attempting to filter out elements from a document that match a certain name. I am trying to do this by getting an elementIterator(), then calling the Iterator.remove() when I find an element I don't want. I get an exception "java.lang.UnsupportedOperationException: remove() is not suppor

Re: [dom4j-dev] Iterator.remove() on elements

2003-12-10 Thread Maarten Coene
Hi David, what happens if you try it this way: Element element = ... ; Iterator it = element.elements().iterator(); while (it.hasNext()) { ... // delete elements you don't want using it.remove(); } Maarten David Frankson wrote: I am attempting to filter out elements from a document that mat

RE: [dom4j-dev] Major bug

2003-12-10 Thread David Hooker
Title: Message I'm confused.  I thought that selectNodes only accepts XPath. -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David ThielenSent: Tuesday, December 09, 2003 10:47 PMTo: [EMAIL PROTECTED]; [EMAIL PROTECTED]Subject: [dom

RE: [dom4j-dev] Major bug

2003-12-10 Thread david
I thought so to. But selectNodes() will return an iterator when given a select, the iterator will return true for hasNext(), but it throws an exception on the first call to next(). - dave -- Original Message -- From: "David Hooker" <[EMAIL PROTECTED]> Da