Using the element's or attribute's QName to track the DocumentFactory implementation gives fast lookup with little added overhead.
Right now the DocumentFactory connection is kind of operating behind the scenes, though. To make it work cleanly you'd need added methods to specify the DocumentFactory for the get() QName calls, and also need to include the DocumentFactory in the QName cache comparison (so that the same QName could be defined with different DocumentFactories). If no DocumentFactory were specified you could just set the default factory when you construct a new QName. - Dennis James Strachan wrote: >This feature allows different named Element/Attributes to have different >factories. e.g. JAXM uses this feature to create different Element >implementations for a SOAP Envelope, Header and Body. Similarly the >datatypes support uses this feature to create type-aware (int, date, float >etc) Element and Attributes based on the 'type' in the schema. > >So if the QName has a DocumentFactory then the getDocument() method on >Element/Attribute should return it, otherwise return the document's >DocumentFactory - is probably a good algorithm for now. > >James > > >_________________________________________________________ >Do You Yahoo!? >Get your free @yahoo.com address at http://mail.yahoo.com > _______________________________________________ dom4j-dev mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-dev