Hi John and all, I started work on the ElementSource again, and this time there's no ElementUtils (i.e. the class with static methods to access element info)!
Instead, I introduced several methods to the ElementSource interface, and implemented them in DOM/OMElementSource classes to access element specific info, as was in the original proposal. These are those methods: getQName(String prefixedValue) getAttribute(String attributeName) getAttributes() getFirstChildElement() As far as I can see, these are the only requirements for the moment. But please advice should there be more. However I also have several concerns over the role of DOM/OMUtils with the introduction of ElementSource: 1. From what I understand, the intent of DOM /OMUtils classes is also to access the element info items to a certain degree. So, should the DOM/OMElementSource act as a replacement for those classes? 2. There are some methods which do much more than accessing element info in DOMUtils. For example, the method DOMUtils.getQName(String,Element,DescriptionElement) which is used in some of the *Deserializer classes, registers the ns prefix in the DescriptionElement if it's not found in the Namespaces map. IMO, it is not right to introduce such a method to the ElementSource interface, as it would seem to do more than what is required by an element wrapper. So, would it be okay to forget about registering the namespace and use something like elementSource.getQName(prefix) instead? If the answers to the above questions are yes & yes, and if nobody else has worked on this, I guess I can commit the code that I've been working on :). Thanks and Regards, Oshani. On 8/1/06, Oshani Seneviratne <[EMAIL PROTECTED]> wrote:
Hi John, The patch for ElementSource implementation is attached at http://issues.apache.org/jira/secure/attachment/12337885/woden-44.patch This patch includes the implementation of the ElementSource and it's related classes in the WODEN-44 branch. With this, I have removed all the DOM dependencies in XMLAttr, ExtensionDeserializer, etc, etc.., In those classes, the relevant method signatures are changed to take in Objects instead of org.w3c.dom.Elements. If a particular attribute in this DOM/OM element wrapped in ElementSource is required, the static methods in the 'ElementUtils' is used. The class ElementUtils, acts as a switch for DOM/OMUtils. However there is no inheritance mechanism here. It is used as an alternative to DOMUtils which was there to get any attribute specific information from the elements. There is a possiblity to remove these static method references, and have the two util classes extend from ElementUtils later. Also QNameUtils is refactored to avoid possible confusion with the same class name in the two o.a.w.i.util.dom/om packages. Regards, Oshani
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
