java - What is the difference between OMNode and OMElement in AXIOM -


what differences , usages between omnode , omelement in axiom ? have implemented xml parser , used both of objects in implementation. omelement sub class of omnode ?

as example both behaves in same way: @ this

//omelement omelement omelement = nodeelement; string attributevalue = ((omelementimpl) omelement).gettext();  //omnode omnode omnode = nodeelement; string attributevalue = ((omelementimpl) omnode).gettext(); 

both support casting , in same way

first of all, code refers omelementimpl. shouldn't that. name of class (and name of package contains class) indicates, implementation class should not used directly in application code. anyways, cast omelementimpl useless because gettext method defined omelement interface.

to answer question, yes, omelement extends omnode, can see in javadoc:

http://ws.apache.org/axiom/apidocs/org/apache/axiom/om/omelement.html

as name indicates, omelement represents xml element. omnode on other hand implemented axiom classes represent xml information item can child of information item (such comment, text node, processing instruction, etc.).


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -