[
https://issues.apache.org/jira/browse/WODEN-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522473
]
Sagara Gunathunga commented on WODEN-180:
------------------------------------------
> You can get the DOM Element representing a wsdl:documentation element via
> DocumentationElement.getContent() which returns an XMLElement object, then
> calling
> MLElement.getSource() and casting the java.lang.Object to an
> org.w3c.dom.Element. Will this help with
> serialization?
This approach is worked well and can be used for serialization. Instead of
Importing org.w3c.dom.Element in to the WSDLWriter, we can hide this logic on
DOM2Util class. (And OMUtil).
> could you describe the use case in a bit more detail .
At the moment it is possible to retrieve attributes and child elements
through the XMLElement interface without worrying about the underline
implementation (DOM or OM). But according to above approach, in order to
retrieve text content, it is required to know the specific implementation.
Case 1: In direct casting approach need to know
Whether the element is org.w3c.dom.Element or org.apache.axiom.om.OMElement.
Case 2: Assume we have implemented this logic on DOM2Util and OMUtil, still
required to know what is the specific implementation (DOM or OM) because no
common interface for DOM2Util and OMUtil classes
As a solution, can define getTextContent() method in XMLElement interface
and can be implemented in DOMXMLElement and OMXMLElement. This will hide the
underline implementation from the users. According to my thinking this would be
a useful method because Most of the WSDL elements are extended from
DocumentableElement
> 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]