[ 
https://issues.apache.org/jira/browse/WODEN-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522559
 ] 

John Kaputin commented on WODEN-180:
------------------------------------

XMLElement is just a lightweight abstraction that keeps the Woden API 
independent of any underlying XML object model and permits some refactoring of 
common code in classes like BaseWSDLReader.  There may still be times when the 
underlying XML object model API is required (e.g. DOM or Axiom) and in these 
cases, knowledge of what to cast to is required (as stated in XMLElement 
javadoc) and it is documented in the implementation javadoc (DOMXMLElement and 
OMXMLEmenent).  We can add methods to XMLElement, but note that it is not 
intended to be a complete abstraction of the DOM and Axiom APIs.

I have some questions about the getTextContent() method proposed for 
XMLElement.  The <wsdl:documentation> element contains 'mixed type' content. 
This includes text nodes and child elements, in any combination. What would be 
the behaviour of getTextContent() and what would it return?  If it returns a 
String representing everything within the documentation element, then it's 
acting like a serializer and the method implementation would still need to use 
the underlying XML object model (e.g. the DOM API)  to get to the text nodes 
and child elements and serialize them.  This behaviour already exists in 
DOM2Writer. Is your proposal to move this behaviour from DOM2Writer to the 
getTextContent() implementation in DOMXMLElement?  If so, perhaps a more 
generally useful solution would be to have the serializeAsXML method of 
DOM2Writer on the XMLElement API, with just one parameter - the Writer.

If there is a requirement here to add support for getting element content other 
than attributes and child elements, then maybe getTextContent() is  not enough. 
Maybe we need something similar to the DOM concept of accessing the child nodes 
of an element (which includes attributes, elements, text, comments, etc).  But 
we need to be careful we don't just end up replicating the DOM and AXIOM APIs. 
It should be driven by use cases and at the moment we have just one - serialize 
DocumentationElement.

> XMLElement should provide a method to retrieve its text content.
> ----------------------------------------------------------------
>
>                 Key: WODEN-180
>                 URL: https://issues.apache.org/jira/browse/WODEN-180
>             Project: Woden
>          Issue Type: Improvement
>          Components: Parser
>            Reporter: Sagara Gunathunga 
>            Priority: Minor
>
> XMLElement should provide a method to retrieve its text content.
> Currently XMLElement provides methods for retrieving child Elements and 
> attributes. When we have text content inside the XMLElement, there is no way 
> to retrieve it. DocumentationElement is a good example for this, where we add 
> human readable text content.
> Because of this deficiency we can't serialize Documentation Element. Wsdl4j 
> facilitates this with the use of org.w3c.dom.Element Interface.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to