Hi Stefan
From: <[EMAIL PROTECTED]>
> I've tried out your Dom4J Package (0.8) for some days and I'm very happy
with
> it.
Great - glad to hear it.
> I've found 2 errors, but I don't know, if this is the right place to
report it.
Sure, its as good a place as any.
> Anyway:
>
> I think, the UserDataDocumentFactory is missing a method:
>
> public Attribute createAttribute(Element owner, QName qname, String value)
>
> You get UserDataElements in your doc, but no UserDataAttributes.
You're right. I've patched the code now - its available in CVS and todays
daily build.
> By the way, i would need SchemaElements, -Factories etc. with a UserData
field,
> to implement a change listener mechanism.
> Have I to extend the schema classes ?
I'd like to add a listener interface to dom4j, providing that its use does
not adversely affect performance of most users.
So hopefully we can have a generic change listener mechansim that could be
shared across all implementations.
I was thinking of something along the lines of
public interface NodeListener {
public void nodeAdded(NodeEvent);
public void nodeChanged(NodeEvent);
public void nodeRemoved(NodeEvent);
}
and NodeEvent looked something like
public class NodeEvent extends EventObject {
...
// the parent element where the node was added or removed
public Element getParent();
// the node that was added or remove d
public Node getNode();
}
then events could ripple up the tree looking for listeners.
Though I'm still thinking about how all this could work neatly.
If we had a generic listener mechansim then hopefully you could just detect
when a node has changed, irrespective of wheher its a UserData based element
/ attribute or a data-type aware element / attribute.
> Other point:
> I want to install a own ErrorHandler:
>
> SAXReader reader = new SAXReader(DEFAULT_PARSER_NAME);
//"org.apache.xerces.parsers.SAXParser";
> reader.setValidation (DEFAULT_PARSER_VALIDATION); //true
> reader.setErrorHandler(new MyReaderErrorHandler());
>
> This doesn't work because of a little bug in SAXReader.setErrorHandler:
> errorHandler = errorHandler // must be this.errorHandler = errorHandler
Thanks for finding that Stefan.
Spookily I stumbled over that one myself as well and fixed it in CVS
yesterday:-
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dom4j/dom4j/src/java/org/dom4
j/io/
Thats the second time in a week that someone on the list has spotted a bug
about the same time as me - great minds think alike eh ;-)
All the patches mentioned are all in CVS and the daily build. Hopefully the
0.9 release will be out really soon - today or tomorrow so you should ahve
these fixes in a standard release very shortly.
James
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev