axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <dava...@gmail.com>
Subject [HELP] SAAJ updates (Re: cvs commit: ws-axis/java/test/wsdl/extensibility ExtensibilityQueryBindingImpl.java ExtensibilityQueryTestCase.java)
Date Sun, 27 Jun 2004 12:34:44 GMT
Ias, Jongjin, Thomas,

Can you please review and suggest other changes that are necessary
(based on your previous experience in refactoring the SAAJ code).

thanks,
dims


On 27 Jun 2004 12:28:32 -0000, dims@apache.org <dims@apache.org> wrote:
> 
> dims        2004/06/27 05:28:32
> 
>   Modified:    java/src/org/apache/axis/encoding/ser BeanDeserializer.java
>                java/src/org/apache/axis/message CommentImpl.java
>                         HeaderBuilder.java InputStreamBody.java
>                         MessageElement.java NamedNodeMapImpl.java
>                         NodeListImpl.java RPCElement.java RPCHandler.java
>                         RPCParam.java SOAPBody.java SOAPBodyElement.java
>                         SOAPDocumentImpl.java SOAPEnvelope.java
>                         SOAPFault.java SOAPFaultBuilder.java
>                         SOAPFaultDetailsBuilder.java
>                         SOAPFaultReasonBuilder.java SOAPHeader.java
>                         SOAPHeaderElement.java Text.java
>                java/test/wsdl/extensibility
>                         ExtensibilityQueryBindingImpl.java
>                         ExtensibilityQueryTestCase.java
>   Added:       java/src/org/apache/axis/message NodeImpl.java
>   Log:
>   SAAJ Conformance (org.apache.axis.message.Text should not implement javax.xml.soap.SOAPElement, it should implement just javax.xml.soap.Node).
> 
>   Notes:
>   - Pass "ant clean all-tests"
>   - Pass SAAJ 1.2 TCK test harness
> 
>   Revision  Changes    Path
>   1.67      +1 -1      ws-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
> 
>   Index: BeanDeserializer.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
>   retrieving revision 1.66
>   retrieving revision 1.67
>   diff -u -r1.66 -r1.67
>   --- BeanDeserializer.java     16 Jun 2004 19:41:20 -0000      1.66
>   +++ BeanDeserializer.java     27 Jun 2004 12:28:31 -0000      1.67
>   @@ -491,7 +491,7 @@
>                    System.arraycopy(curElements, 0,
>                            newElements, 0, length);
>                }
>   -            MessageElement thisEl = new org.apache.axis.message.Text(textValue);
>   +            MessageElement thisEl = new MessageElement(new org.apache.axis.message.Text(textValue));
>                newElements[length] = thisEl;
>                propDesc.set(value, newElements);
>            } catch (Exception e) {
> 
>   1.3       +2 -2      ws-axis/java/src/org/apache/axis/message/CommentImpl.java
> 
>   Index: CommentImpl.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/CommentImpl.java,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- CommentImpl.java  25 Feb 2004 14:02:42 -0000      1.2
>   +++ CommentImpl.java  27 Jun 2004 12:28:31 -0000      1.3
>   @@ -16,10 +16,10 @@
> 
>    package org.apache.axis.message;
> 
>   -import javax.xml.soap.Text;
>   -
>    import org.w3c.dom.Comment;
>    import org.w3c.dom.DOMException;
>   +
>   +import javax.xml.soap.Text;
> 
>    /**
>     * Most of methods are inherited from TEXT, defined for its Interface Marker
> 
>   1.26      +3 -3      ws-axis/java/src/org/apache/axis/message/HeaderBuilder.java
> 
>   Index: HeaderBuilder.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/HeaderBuilder.java,v
>   retrieving revision 1.25
>   retrieving revision 1.26
>   diff -u -r1.25 -r1.26
>   --- HeaderBuilder.java        25 Feb 2004 14:02:42 -0000      1.25
>   +++ HeaderBuilder.java        27 Jun 2004 12:28:31 -0000      1.26
>   @@ -21,12 +21,12 @@
>     * @author Glen Daniels (gdaniels@allaire.com)
>     */
> 
>   +import org.apache.axis.AxisFault;
>   +import org.apache.axis.Constants;
>    import org.apache.axis.components.logger.LogFactory;
>    import org.apache.axis.encoding.DeserializationContext;
>   -import org.apache.axis.Constants;
>   -import org.apache.axis.utils.Messages;
>   -import org.apache.axis.AxisFault;
>    import org.apache.axis.soap.SOAPConstants;
>   +import org.apache.axis.utils.Messages;
>    import org.apache.commons.logging.Log;
>    import org.xml.sax.Attributes;
>    import org.xml.sax.SAXException;
> 
>   1.19      +1 -1      ws-axis/java/src/org/apache/axis/message/InputStreamBody.java
> 
>   Index: InputStreamBody.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/InputStreamBody.java,v
>   retrieving revision 1.18
>   retrieving revision 1.19
>   diff -u -r1.18 -r1.19
>   --- InputStreamBody.java      25 Feb 2004 14:02:42 -0000      1.18
>   +++ InputStreamBody.java      27 Jun 2004 12:28:31 -0000      1.19
>   @@ -18,8 +18,8 @@
> 
>    import org.apache.axis.components.logger.LogFactory;
>    import org.apache.axis.encoding.SerializationContext;
>   -import org.apache.axis.utils.Messages;
>    import org.apache.axis.utils.IOUtils;
>   +import org.apache.axis.utils.Messages;
>    import org.apache.commons.logging.Log;
> 
>    import java.io.IOException;
> 
>   1.174     +52 -375   ws-axis/java/src/org/apache/axis/message/MessageElement.java
> 
>   Index: MessageElement.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/MessageElement.java,v
>   retrieving revision 1.173
>   retrieving revision 1.174
>   diff -u -r1.173 -r1.174
>   --- MessageElement.java       24 Jun 2004 12:27:37 -0000      1.173
>   +++ MessageElement.java       27 Jun 2004 12:28:31 -0000      1.174
>   @@ -38,7 +38,6 @@
>    import org.w3c.dom.DOMException;
>    import org.w3c.dom.Document;
>    import org.w3c.dom.Element;
>   -import org.w3c.dom.NamedNodeMap;
>    import org.w3c.dom.Node;
>    import org.w3c.dom.NodeList;
>    import org.w3c.dom.Text;
>   @@ -69,7 +68,7 @@
>     * Note: it was made Serializable to help users of Apache SOAP who had
>     * exploited the serializability of the DOM tree to migrate to Axis.
>     */
>   -public class MessageElement implements SOAPElement,
>   +public class MessageElement extends NodeImpl implements SOAPElement,
>            Serializable,
>            org.w3c.dom.NodeList,  // ADD Nodelist Interfaces for SAAJ 1.2
>            Cloneable
>   @@ -85,15 +84,10 @@
>                new Mapping(Constants.URI_SOAP12_ENC,
>                            "SOAP-ENC");
> 
>   -    protected String    name ;
>   -    protected String    prefix ;
>   -    protected String    namespaceURI ;
>   -    protected transient Attributes attributes = NullAttributes.singleton;
>        protected String    id;
>        protected String    href;
>        protected boolean   _isRoot = true;
>        protected SOAPEnvelope message = null;
>   -    protected boolean   _isDirty = false;
> 
>        protected transient DeserializationContext context;
> 
>   @@ -107,11 +101,6 @@
>        protected int startContentsIndex = 0;
>        protected int endEventIndex = -1;
> 
>   -    // ...or as DOM
>   -    protected CharacterData textRep = null;
>   -
>   -    protected MessageElement parent = null;
>   -
>        public ArrayList namespaces = null;
> 
>        /** Our encoding style, if any */
>   @@ -286,16 +275,6 @@
>            //context.setRecorder(null);
>        }
> 
>   -    public boolean isDirty() { return _isDirty; }
>   -
>   -    public void setDirty(boolean dirty)
>   -    {
>   -        _isDirty = dirty;
>   -        if (_isDirty && parent != null) {
>   -            parent.setDirty(true);
>   -        }
>   -    }
>   -
>        public boolean isRoot() { return _isRoot; }
>        public String getID() { return id; }
> 
>   @@ -303,69 +282,42 @@
> 
>        public Attributes getAttributesEx() { return attributes; }
> 
>   -    public Node getFirstChild()
>   -    {
>   -        if (children != null && !children.isEmpty()) {
>   -            return (Node)children.get(0);
>   -        } else {
>   -            return null;
>   -        }
>   -    }
>   -
>   -    public Node getLastChild()
>   -    {
>   -        if (children != null && !children.isEmpty()) {
>   -            return (Node)children.get(children.size()-1);
>   -        } else {
>   -            return null;
>   -        }
>   -    }
>   -
>   -    public Node getNextSibling() {
>   -        SOAPElement parent = getParentElement();
>   -        if(parent == null){
>   -            return null;
>   -        }
>   -        Iterator iter = parent.getChildElements();
>   -        Node nextSibling = null;
>   -        while(iter.hasNext()) {
>   -            if(iter.next().equals(this)){
>   -                if(iter.hasNext()){
>   -                    return (Node)iter.next();
>   -                }else{
>   -                    return null;
>   -                }
>   -            }
>   -        }
>   -        return nextSibling; // should be null.
>   -    }
>   -
>   -    public Node getParentNode() {
>   -        return parent;
>   -    }
>   -
>   -    public Node getPreviousSibling() {
>   -        SOAPElement parent = getParentElement();
>   -        Iterator iter = parent.getChildElements();
>   -        Node previousSibling = null;
>   -        while(iter.hasNext()) {
>   -            if(iter.next().equals(this)){
>   -                return  previousSibling;
>   -            }
>   -        }
>   -        return previousSibling; // should be null.
>   -    }
> 
>   +    /**
>   +     * Returns a duplicate of this node, i.e., serves as a generic copy
>   +     * constructor for nodes. The duplicate node has no parent; (
>   +     * <code>parentNode</code> is <code>null</code>.).
>   +     * <br>Cloning an <code>Element</code> copies all attributes and their
>   +     * values, including those generated by the XML processor to represent
>   +     * defaulted attributes, but this method does not copy any text it
>   +     * contains unless it is a deep clone, since the text is contained in a
>   +     * child <code>Text</code> node. Cloning an <code>Attribute</code>
>   +     * directly, as opposed to be cloned as part of an <code>Element</code>
>   +     * cloning operation, returns a specified attribute (
>   +     * <code>specified</code> is <code>true</code>). Cloning any other type
>   +     * of node simply returns a copy of this node.
>   +     * <br>Note that cloning an immutable subtree results in a mutable copy,
>   +     * but the children of an <code>EntityReference</code> clone are readonly
>   +     * . In addition, clones of unspecified <code>Attr</code> nodes are
>   +     * specified. And, cloning <code>Document</code>,
>   +     * <code>DocumentType</code>, <code>Entity</code>, and
>   +     * <code>Notation</code> nodes is implementation dependent.
>   +     *
>   +     * @param deep If <code>true</code>, recursively clone the subtree under
>   +     *             the specified node; if <code>false</code>, clone only the node
>   +     *             itself (and its attributes, if it is an <code>Element</code>).
>   +     * @return The duplicate node.
>   +     */
>        public Node cloneNode(boolean deep) {
>            try{
>   -            MessageElement clonedSelf = (MessageElement) this.clonning();
>   +            MessageElement clonedSelf = (MessageElement) clonning();
> 
>                if(deep == true){
>                    if(children != null){
>                        for(int i =0; i < children.size(); i++){
>   -                        MessageElement child = (MessageElement)children.get(i);
>   +                        NodeImpl child = (NodeImpl)children.get(i);
>                            if(child != null) {  // why child can be null?
>   -                            MessageElement clonedChild = (MessageElement)child.cloneNode(deep); // deep == true
>   +                            NodeImpl clonedChild = (NodeImpl)child.cloneNode(deep); // deep == true
>                                clonedChild.setParent(clonedSelf);
>                                clonedChild.setOwnerDocument(soapPart);
>                            }
>   @@ -378,7 +330,6 @@
>                return null;
>            }
>        }
>   -
>        /**
>         *  protected clone method (not public)
>         *
>   @@ -392,7 +343,6 @@
>         *  protected String    href;             Y?
>         *  protected boolean   _isRoot = true;   Y?
>         *  protected SOAPEnvelope message = null; N?
>   -     *  protected boolean   _isDirty = false;  Y?
>         *  protected transient DeserializationContext context;  Y?
>         *  protected transient QName typeQName = null;          Y?
>         *  protected Vector qNameAttrs = null;                  Y?
>   @@ -458,53 +408,6 @@
>            removeContents();
>        }
> 
>   -    public NodeList getChildNodes() {
>   -        return this;
>   -    }
>   -
>   -    public boolean isSupported(String feature, String version) {
>   -        return false;  //TODO: Fix this for SAAJ 1.2 Implementation
>   -    }
>   -
>   -    public Node appendChild(Node newChild) throws DOMException {
>   -        initializeChildren();
>   -        children.add(newChild);
>   -        return newChild;
>   -    }
>   -
>   -    public Node removeChild(Node oldChild) throws DOMException {
>   -        initializeChildren();
>   -        int position = children.indexOf(oldChild);
>   -        if(position < 0) {
>   -            throw new DOMException(DOMException.NOT_FOUND_ERR,
>   -                                   "MessageElement Not found");
>   -        }
>   -        children.remove(position);
>   -        return oldChild;
>   -    }
>   -
>   -    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
>   -        initializeChildren();
>   -        int position = children.indexOf(refChild);
>   -        if (position < 0) {
>   -            position = 0;
>   -        }
>   -        children.add(position,newChild);
>   -        return newChild;
>   -    }
>   -
>   -    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
>   -        initializeChildren();
>   -        int position = children.indexOf(oldChild);
>   -        if(position < 0) {
>   -            throw new DOMException(DOMException.NOT_FOUND_ERR,
>   -                                   "MessageElement Not found");
>   -        }
>   -        children.remove(position);
>   -        children.add(position, newChild);
>   -        return oldChild;
>   -    }
>   -
>        /**
>         * Obtain an Attributes collection consisting of all attributes
>         * for this MessageElement, including namespace declarations.
>   @@ -540,117 +443,6 @@
>            this.namespaceURI = qName.getNamespaceURI();
>        }
> 
>   -    public String getPrefix() { return( prefix ); }
>   -
>   -    public void setNodeValue(String nodeValue) throws DOMException {
>   -        throw new DOMException(DOMException.NO_DATA_ALLOWED_ERR,
>   -                "Cannot use TextNode.set in " + this);
>   -    }
>   -
>   -    public void setPrefix(String prefix) { this.prefix = prefix; }
>   -
>   -    public Document getOwnerDocument() {
>   -        return soapPart;
>   -    }
>   -
>   -    public NamedNodeMap getAttributes() {
>   -        // make first it is editable.
>   -        makeAttributesEditable();
>   -        return convertAttrSAXtoDOM(attributes);
>   -    }
>   -
>   -    /**
>   -     * @todo  In order to be compatible SAAJ Spec(ver 1.2),
>   -     * The internal representation of Attributes cannot help being changed
>   -     * It is because Attribute is not immutible Type, so if we keep out value and
>   -     * just return it in another form, the application may chnae it, which we cannot
>   -     * detect without some kind back track method (call back notifying the chnage.)
>   -     * I am not sure which approach is better.
>   -     *
>   -     */
>   -
>   -    private NamedNodeMap convertAttrSAXtoDOM(Attributes saxAttr)
>   -    {
>   -        try{
>   -            org.w3c.dom.Document doc = org.apache.axis.utils.XMLUtils.newDocument();
>   -
>   -            AttributesImpl saxAttrs =  (AttributesImpl)saxAttr;
>   -            NamedNodeMap domAttributes = new NamedNodeMapImpl();
>   -            for(int i = 0; i < saxAttrs.getLength(); i++){
>   -                String uri = saxAttrs.getURI(i);
>   -                String qname = saxAttrs.getQName(i);
>   -                String value = saxAttrs.getValue(i);
>   -
>   -                if(uri != null && uri.trim().length() > 0){
>   -                    // filterring out the tricky method to differentiate the null namespace
>   -                    // -ware case
>   -                    if(uri.equals("intentionalNullURI")){
>   -                        uri = null;
>   -                    }
>   -                    Attr attr = doc.createAttributeNS(uri,qname);
>   -                    attr.setValue(value);
>   -                    domAttributes.setNamedItemNS(attr);
>   -                }else{
>   -
>   -                    Attr attr = doc.createAttribute(qname);
>   -                    attr.setValue(value);
>   -                    domAttributes.setNamedItem(attr);
>   -                }
>   -            }
>   -            return domAttributes;
>   -
>   -        }catch(Exception ex){
>   -            ex.printStackTrace();
>   -            return null;
>   -        }
>   -
>   -    }
>   -
>   -    public short getNodeType() {
>   -        if(this.textRep != null) {
>   -            if(textRep instanceof Comment) {
>   -                return COMMENT_NODE;
>   -            } else if(textRep instanceof CDATASection) {
>   -                    return CDATA_SECTION_NODE;
>   -            } else {
>   -            return TEXT_NODE;
>   -            }
>   -        }else if(false){
>   -            return DOCUMENT_FRAGMENT_NODE;
>   -        }else if(false){
>   -            return Node.ELEMENT_NODE;
>   -        }else{ // most often but we cannot give prioeity now
>   -            return Node.ELEMENT_NODE;
>   -        }
>   -    }
>   -
>   -    public void normalize() {
>   -        //TODO: Fix this for SAAJ 1.2 Implementation
>   -    }
>   -
>   -    public boolean hasAttributes() {
>   -        return attributes.getLength() > 0;
>   -    }
>   -
>   -    public boolean hasChildNodes() {
>   -        return (children != null && !children.isEmpty());
>   -    }
>   -
>   -    public String getLocalName() {
>   -        return name;
>   -    }
>   -
>   -    public String getNamespaceURI() { return( namespaceURI ); }
>   -
>   -    public String getNodeName() {
>   -        return (prefix != null)? prefix + ":" + name : name;
>   -    }
>   -
>   -    public String getNodeValue() throws DOMException {
>   -        throw new DOMException(DOMException.NO_DATA_ALLOWED_ERR,
>   -                "Cannot use TextNode.get in " + this);
>   -    }
>   -
>        public void setNamespaceURI(String nsURI) { namespaceURI = nsURI; }
> 
>        public QName getType() {
>   @@ -681,7 +473,7 @@
>            if (encodingStyle == null) {
>                if (parent == null)
>                    return "";
>   -            return parent.getEncodingStyle();
>   +            return ((MessageElement)parent).getEncodingStyle();
>            }
>            return encodingStyle;
>        }
>   @@ -691,7 +483,7 @@
>            if(children != null) {
>                for(int i = 0; i < children.size(); i++){
>                    try{
>   -                    ((MessageElement)children.get(i)).setParent(null);
>   +                    ((NodeImpl)children.get(i)).setParent(null);
>                    }catch(Exception e){
>                    }
>                }
>   @@ -706,7 +498,7 @@
> 
>            // Add all parents namespace definitions
>            if(parent !=null){
>   -            Iterator parentsPrefixes = parent.getVisibleNamespacePrefixes();
>   +            Iterator parentsPrefixes = ((MessageElement)parent).getVisibleNamespacePrefixes();
>                if(parentsPrefixes != null){
>                    while(parentsPrefixes.hasNext()){
>                        prefixes.add(parentsPrefixes.next());
>   @@ -750,31 +542,6 @@
>            }
>        }
> 
>   -    private MessageElement getParent() { return parent; }
>   -
>   -    private void setParent(MessageElement parent) throws SOAPException
>   -    {
>   -        if (this.parent == parent) {
>   -            return;
>   -        }
>   -        if (this.parent != null) {
>   -            this.parent.removeChild(this);
>   -        }
>   -        if (parent != null) {
>   -            parent.addChild(this);
>   -        }
>   -        this.parent = parent;
>   -    }
>   -
>   -    protected List children = null;
>   -
>   -    protected void initializeChildren()
>   -    {
>   -        if (children == null) {
>   -            children = new ArrayList();
>   -        }
>   -    }
>   -
>        /**
>         * Note that this method will log a error and no-op if there is
>         * a value (set using setObjectValue) in the MessageElement.
>   @@ -792,26 +559,6 @@
>            el.parent = this;
>        }
> 
>   -    /**
>   -     * Remove a child element.
>   -     */
>   -    public void removeChild(MessageElement child)
>   -    {
>   -        if (children == null) {
>   -            return;
>   -        }
>   -        // Remove all occurrences in case it has been added multiple times.
>   -        boolean removed = false;
>   -        int i;
>   -        while ((i = children.indexOf(child)) != -1) {
>   -            children.remove(i);
>   -            removed = true;
>   -        }
>   -        if (removed) {
>   -            setDirty(removed);
>   -        }
>   -    }
>   -
>        public List getChildren()
>        {
>            return children;
>   @@ -842,7 +589,7 @@
>            }
> 
>            if (parent != null)
>   -            return parent.getPrefix(namespaceURI);
>   +            return ((MessageElement)parent).getPrefix(namespaceURI);
> 
>            return null;
>        }
>   @@ -863,7 +610,7 @@
>            }
> 
>            if (parent != null)
>   -            return parent.getNamespaceURI(prefix);
>   +            return ((MessageElement)parent).getNamespaceURI(prefix);
> 
>            if (log.isDebugEnabled()) {
>                log.debug(Messages.getMessage("noPrefix00", "" + this, prefix));
>   @@ -971,16 +718,6 @@
>            // !!! Add attribute to attributes!
>        }
> 
>   -    protected AttributesImpl makeAttributesEditable() {
>   -        if (attributes == null || attributes instanceof NullAttributes) {
>   -            attributes =  new AttributesImpl();
>   -        } else if (!(attributes instanceof AttributesImpl)) {
>   -            attributes = new AttributesImpl(attributes);
>   -        }
>   -
>   -        return (AttributesImpl) attributes;
>   -    }
>   -
>        public void addAttribute(String namespace, String localName,
>                                 String value)
>        {
>   @@ -1152,7 +889,7 @@
>                                     Constants.ATTR_ENCODING_STYLE,
>                                     encodingStyle);
>                    }
>   -            } else if (!encodingStyle.equals(parent.getEncodingStyle())) {
>   +            } else if (!encodingStyle.equals(((MessageElement)parent).getEncodingStyle())) {
>                    setAttribute(soapConstants.getEnvelopeURI(),
>                                 Constants.ATTR_ENCODING_STYLE,
>                                 encodingStyle);
>   @@ -1204,7 +941,7 @@
>            context.startElement(new QName(namespaceURI, name), attributes);
>            if (children != null) {
>                for (Iterator it = children.iterator(); it.hasNext();) {
>   -                ((MessageElement)it.next()).output(context);
>   +                ((NodeImpl)it.next()).output(context);
>                }
>            }
>            context.endElement();
>   @@ -1226,75 +963,6 @@
>            namespaces.add(map);
>        }
> 
>   -    // JAXM Node methods...
>   -    /**
>   -     * Returns the the value of the immediate child of this <code>Node</code>
>   -     * object if a child exists and its value is text.
>   -     * @return  a <code>String</code> with the text of the immediate child of
>   -     *    this <code>Node</code> object if (1) there is a child and
>   -     *    (2) the child is a <code>Text</code> object;
>   -     *      <code>null</code> otherwise
>   -     */
>   -    public String getValue() {
>   -        try {
>   -            Element element = getAsDOM();
>   -            if(element.hasChildNodes()){
>   -                org.w3c.dom.Node node = element.getFirstChild();
>   -                if(node.getNodeType()==org.w3c.dom.Node.TEXT_NODE){
>   -                    return node.getNodeValue();
>   -                }
>   -            }
>   -        } catch (Exception t){
>   -            log.debug("getValue()", t);
>   -        }
>   -        return null;
>   -    }
>   -
>   -    public void setParentElement(SOAPElement parent) throws SOAPException {
>   -        if(parent == null)
>   -            throw new IllegalArgumentException(Messages.getMessage("nullParent00"));
>   -        try {
>   -            setParent((MessageElement)parent);
>   -        } catch (Throwable t) {
>   -            throw new SOAPException(t);
>   -        }
>   -    }
>   -
>   -    public SOAPElement getParentElement() {
>   -        return getParent();
>   -    }
>   -
>   -    /**
>   -     * Break the relationship between this element and its parent, if any.
>   -     */
>   -    public void detachNode() {
>   -        if (parent != null) {
>   -            parent.removeChild(this);
>   -            parent = null;
>   -        }
>   -    }
>   -
>   -    /**
>   -     * No-opped - Axis does not recycle nodes.
>   -     */
>   -    public void recycleNode() {}
>   -
>   -    public void setValue(String value) {
>   -        if(this instanceof org.apache.axis.message.Text){
>   -            this.setNodeValue(value);
>   -            return;
>   -        }
>   -        if(children != null)
>   -            for(int i = 0; i < children.size(); i++){
>   -                MessageElement child = (MessageElement)children.get(i);
>   -                if(child instanceof org.apache.axis.message.Text){
>   -                    child.setValue(value);
>   -                    return;
>   -                }
>   -            }
>   -        throw new IllegalStateException("Cannot call set for Non Text Node");
>   -    }
>   -
>        // JAXM SOAPElement methods...
> 
>        public SOAPElement addChildElement(Name name) throws SOAPException {
>   @@ -1354,7 +1022,7 @@
>        public SOAPElement addTextNode(String s) throws SOAPException {
>            org.apache.axis.message.Text text = new org.apache.axis.message.Text(s);
>            try {
>   -            addChild(text);
>   +            appendChild(text);
>                return this;
>            } catch (ClassCastException e) {
>                throw new SOAPException(e);
>   @@ -1678,12 +1346,6 @@
>            return matches;
>        }
> 
>   -    protected org.apache.axis.SOAPPart soapPart = null;
>   -
>   -    public void setOwnerDocument(org.apache.axis.SOAPPart sp){
>   -        soapPart = sp;
>   -    }
>   -
>        public Node item(int index) {
>            if(children !=null && children.size() > index){
>                return (Node)children.get(index);
>   @@ -1776,5 +1438,20 @@
>                    copyNode(childElement, child);
>                }
>            }
>   +    }
>   +
>   +    public String getValue() {
>   +        try {
>   +            Element element = getAsDOM();
>   +            if(element.hasChildNodes()){
>   +                org.w3c.dom.Node node = element.getFirstChild();
>   +                if(node.getNodeType()==org.w3c.dom.Node.TEXT_NODE){
>   +                    return node.getNodeValue();
>   +                }
>   +            }
>   +        } catch (Exception t){
>   +            log.debug("getValue()", t);
>   +        }
>   +        return null;
>        }
>    }
> 
>   1.3       +5 -2      ws-axis/java/src/org/apache/axis/message/NamedNodeMapImpl.java
> 
>   Index: NamedNodeMapImpl.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/NamedNodeMapImpl.java,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- NamedNodeMapImpl.java     25 Feb 2004 14:02:42 -0000      1.2
>   +++ NamedNodeMapImpl.java     27 Jun 2004 12:28:31 -0000      1.3
>   @@ -16,11 +16,14 @@
> 
>    package org.apache.axis.message;
> 
>   +import org.w3c.dom.Attr;
>   +import org.w3c.dom.DOMException;
>   +import org.w3c.dom.Document;
>    import org.w3c.dom.NamedNodeMap;
>   -import org.w3c.dom.*;
>   +import org.w3c.dom.Node;
> 
>   -import java.util.Vector;
>    import java.util.Iterator;
>   +import java.util.Vector;
> 
>    /**
>     * A W3C simple DOM NameNodeMap implementation
> 
>   1.4       +7 -1      ws-axis/java/src/org/apache/axis/message/NodeListImpl.java
> 
>   Index: NodeListImpl.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/NodeListImpl.java,v
>   retrieving revision 1.3
>   retrieving revision 1.4
>   diff -u -r1.3 -r1.4
>   --- NodeListImpl.java 8 Apr 2004 13:09:06 -0000       1.3
>   +++ NodeListImpl.java 27 Jun 2004 12:28:31 -0000      1.4
>   @@ -16,8 +16,10 @@
> 
>    package org.apache.axis.message;
> 
>   -import org.w3c.dom.NodeList;
>    import org.w3c.dom.Node;
>   +import org.w3c.dom.NodeList;
>   +
>   +import java.util.Collection;
>    import java.util.Vector;
> 
>    /**
>   @@ -40,6 +42,10 @@
> 
>        NodeListImpl(Vector nodes) {
>            mNodes = nodes;
>   +    }
>   +
>   +    NodeListImpl(Collection nodes) {
>   +        mNodes = new Vector(nodes);
>        }
> 
>        void addNode(org.w3c.dom.Node node) {
> 
>   1.92      +1 -1      ws-axis/java/src/org/apache/axis/message/RPCElement.java
> 
>   Index: RPCElement.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/RPCElement.java,v
>   retrieving revision 1.91
>   retrieving revision 1.92
>   diff -u -r1.91 -r1.92
>   --- RPCElement.java   21 Jun 2004 21:23:30 -0000      1.91
>   +++ RPCElement.java   27 Jun 2004 12:28:31 -0000      1.92
>   @@ -28,9 +28,9 @@
>    import org.apache.axis.enum.Style;
>    import org.apache.axis.enum.Use;
>    import org.apache.axis.handlers.soap.SOAPService;
>   +import org.apache.axis.soap.SOAPConstants;
>    import org.apache.axis.utils.JavaUtils;
>    import org.apache.axis.utils.Messages;
>   -import org.apache.axis.soap.SOAPConstants;
>    import org.apache.axis.wsdl.toJava.Utils;
>    import org.xml.sax.Attributes;
>    import org.xml.sax.SAXException;
> 
>   1.77      +3 -3      ws-axis/java/src/org/apache/axis/message/RPCHandler.java
> 
>   Index: RPCHandler.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/RPCHandler.java,v
>   retrieving revision 1.76
>   retrieving revision 1.77
>   diff -u -r1.76 -r1.77
>   --- RPCHandler.java   11 May 2004 13:31:00 -0000      1.76
>   +++ RPCHandler.java   27 Jun 2004 12:28:31 -0000      1.77
>   @@ -21,8 +21,8 @@
>     * @author Glen Daniels (gdaniels@allaire.com)
>     */
> 
>   -import org.apache.axis.Constants;
>    import org.apache.axis.AxisFault;
>   +import org.apache.axis.Constants;
>    import org.apache.axis.components.logger.LogFactory;
>    import org.apache.axis.description.OperationDesc;
>    import org.apache.axis.description.ParameterDesc;
>   @@ -31,13 +31,13 @@
>    import org.apache.axis.encoding.DeserializerImpl;
>    import org.apache.axis.encoding.MethodTarget;
>    import org.apache.axis.encoding.XMLType;
>   +import org.apache.axis.soap.SOAPConstants;
>    import org.apache.axis.utils.JavaUtils;
>    import org.apache.axis.utils.Messages;
>   -import org.apache.axis.soap.SOAPConstants;
>    import org.apache.commons.logging.Log;
>   +import org.w3c.dom.Element;
>    import org.xml.sax.Attributes;
>    import org.xml.sax.SAXException;
>   -import org.w3c.dom.Element;
> 
>    import javax.xml.namespace.QName;
>    import java.util.Vector;
> 
>   1.59      +1 -1      ws-axis/java/src/org/apache/axis/message/RPCParam.java
> 
>   Index: RPCParam.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/RPCParam.java,v
>   retrieving revision 1.58
>   retrieving revision 1.59
>   diff -u -r1.58 -r1.59
>   --- RPCParam.java     25 Feb 2004 14:02:42 -0000      1.58
>   +++ RPCParam.java     27 Jun 2004 12:28:31 -0000      1.59
>   @@ -18,8 +18,8 @@
>    import org.apache.axis.components.logger.LogFactory;
>    import org.apache.axis.description.ParameterDesc;
>    import org.apache.axis.encoding.SerializationContext;
>   -import org.apache.axis.utils.Messages;
>    import org.apache.axis.utils.JavaUtils;
>   +import org.apache.axis.utils.Messages;
>    import org.apache.commons.logging.Log;
> 
>    import javax.xml.namespace.QName;
> 
>   1.53      +6 -21     ws-axis/java/src/org/apache/axis/message/SOAPBody.java
> 
>   Index: SOAPBody.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPBody.java,v
>   retrieving revision 1.52
>   retrieving revision 1.53
>   diff -u -r1.52 -r1.53
>   --- SOAPBody.java     22 Jun 2004 23:51:32 -0000      1.52
>   +++ SOAPBody.java     27 Jun 2004 12:28:31 -0000      1.53
>   @@ -24,20 +24,19 @@
>    import org.apache.axis.soap.SOAPConstants;
>    import org.apache.axis.utils.Messages;
>    import org.apache.commons.logging.Log;
>   -import org.xml.sax.Attributes;
>   -import org.w3c.dom.Element;
>    import org.w3c.dom.Document;
>   +import org.w3c.dom.Element;
>   +import org.xml.sax.Attributes;
> 
>    import javax.xml.namespace.QName;
>    import javax.xml.soap.Name;
>    import javax.xml.soap.SOAPElement;
>    import javax.xml.soap.SOAPException;
>   -import java.util.Enumeration;
>   -import java.util.Vector;
>    import java.util.ArrayList;
>   -import java.util.Locale;
>   -import java.util.List;
>    import java.util.Iterator;
>   +import java.util.List;
>   +import java.util.Locale;
>   +import java.util.Vector;
> 
>    /**
>     * Holder for body elements.
>   @@ -93,13 +92,6 @@
>            }
>        }
> 
>   -    public void detachNode() {
>   -        if (parent != null) {
>   -            ((SOAPEnvelope)parent).removeBody();
>   -        }
>   -        super.detachNode();
>   -    }
>   -
>        public void disableFormatting() {
>            this.disableFormatting = true;
>        }
>   @@ -158,16 +150,9 @@
>            context.setPretty(oldPretty);
>        }
> 
>   -    protected void initializeChildren()
>   -    {
>   -        if (children == null) {
>   -            children = new Vector();
>   -        }
>   -    }
>   -
>        Vector getBodyElements() throws AxisFault {
>            initializeChildren();
>   -        return (Vector)getChildren();
>   +        return new Vector(getChildren());
>        }
> 
>        SOAPBodyElement getFirstBody() throws AxisFault
> 
>   1.35      +2 -2      ws-axis/java/src/org/apache/axis/message/SOAPBodyElement.java
> 
>   Index: SOAPBodyElement.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPBodyElement.java,v
>   retrieving revision 1.34
>   retrieving revision 1.35
>   diff -u -r1.34 -r1.35
>   --- SOAPBodyElement.java      22 Jun 2004 17:42:50 -0000      1.34
>   +++ SOAPBodyElement.java      27 Jun 2004 12:28:31 -0000      1.35
>   @@ -15,8 +15,8 @@
>     */
>    package org.apache.axis.message;
> 
>   -import org.apache.axis.InternalException;
>    import org.apache.axis.AxisFault;
>   +import org.apache.axis.InternalException;
>    import org.apache.axis.components.logger.LogFactory;
>    import org.apache.axis.encoding.DeserializationContext;
>    import org.apache.axis.utils.Messages;
>   @@ -25,10 +25,10 @@
>    import org.w3c.dom.Element;
>    import org.xml.sax.Attributes;
> 
>   +import javax.xml.namespace.QName;
>    import javax.xml.soap.Name;
>    import javax.xml.soap.SOAPElement;
>    import javax.xml.soap.SOAPException;
>   -import javax.xml.namespace.QName;
>    import java.io.InputStream;
> 
>    /**
> 
>   1.7       +3 -3      ws-axis/java/src/org/apache/axis/message/SOAPDocumentImpl.java
> 
>   Index: SOAPDocumentImpl.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPDocumentImpl.java,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- SOAPDocumentImpl.java     21 Jun 2004 21:28:37 -0000      1.6
>   +++ SOAPDocumentImpl.java     27 Jun 2004 12:28:31 -0000      1.7
>   @@ -16,9 +16,6 @@
> 
>    package org.apache.axis.message;
> 
>   -import javax.xml.parsers.ParserConfigurationException;
>   -import javax.xml.soap.SOAPException;
>   -
>    import org.apache.axis.AxisFault;
>    import org.apache.axis.Constants;
>    import org.apache.axis.SOAPPart;
>   @@ -37,6 +34,9 @@
>    import org.w3c.dom.Node;
>    import org.w3c.dom.NodeList;
>    import org.w3c.dom.ProcessingInstruction;
>   +
>   +import javax.xml.parsers.ParserConfigurationException;
>   +import javax.xml.soap.SOAPException;
> 
>    /**
>     * SOAPDcoumentImpl implements the Document API for SOAPPART. At the moment, it
> 
>   1.96      +13 -2     ws-axis/java/src/org/apache/axis/message/SOAPEnvelope.java
> 
>   Index: SOAPEnvelope.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPEnvelope.java,v
>   retrieving revision 1.95
>   retrieving revision 1.96
>   diff -u -r1.95 -r1.96
>   --- SOAPEnvelope.java 23 Jun 2004 04:14:31 -0000      1.95
>   +++ SOAPEnvelope.java 27 Jun 2004 12:28:31 -0000      1.96
>   @@ -19,17 +19,19 @@
>    import org.apache.axis.Constants;
>    import org.apache.axis.Message;
>    import org.apache.axis.MessageContext;
>   -import org.apache.axis.schema.SchemaVersion;
>    import org.apache.axis.client.AxisClient;
>    import org.apache.axis.components.logger.LogFactory;
>    import org.apache.axis.configuration.NullProvider;
>    import org.apache.axis.encoding.DeserializationContext;
>    import org.apache.axis.encoding.DeserializationContextImpl;
>    import org.apache.axis.encoding.SerializationContext;
>   +import org.apache.axis.schema.SchemaVersion;
>    import org.apache.axis.soap.SOAPConstants;
>    import org.apache.axis.utils.Mapping;
>    import org.apache.axis.utils.Messages;
>    import org.apache.commons.logging.Log;
>   +import org.w3c.dom.DOMException;
>   +import org.w3c.dom.Node;
>    import org.xml.sax.InputSource;
>    import org.xml.sax.SAXException;
> 
>   @@ -459,7 +461,7 @@
>            // Output non-SOAPHeader and non-SOAPBody stuff.
>            Iterator i = getChildElements();
>            while (i.hasNext()) {
>   -            MessageElement element = (MessageElement)i.next();
>   +            NodeImpl element = (NodeImpl)i.next();
>                if(element instanceof SOAPHeader ||
>                   element instanceof SOAPBody)
>                    continue;
>   @@ -597,5 +599,14 @@
> 
>        public void setSAAJEncodingCompliance(boolean comply) {
>            this.body.setSAAJEncodingCompliance(comply);
>   +    }
>   +
>   +    public Node removeChild(Node oldChild) throws DOMException {
>   +        if(oldChild == header) {
>   +            header = null;
>   +        } else if(oldChild == body) {
>   +            body = null;
>   +        }
>   +        return super.removeChild(oldChild);
>        }
>    }
> 
>   1.28      +3 -3      ws-axis/java/src/org/apache/axis/message/SOAPFault.java
> 
>   Index: SOAPFault.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPFault.java,v
>   retrieving revision 1.27
>   retrieving revision 1.28
>   diff -u -r1.27 -r1.28
>   --- SOAPFault.java    22 Jun 2004 17:42:50 -0000      1.27
>   +++ SOAPFault.java    27 Jun 2004 12:28:31 -0000      1.28
>   @@ -29,13 +29,13 @@
>    import org.xml.sax.helpers.AttributesImpl;
> 
>    import javax.xml.namespace.QName;
>   -import javax.xml.soap.SOAPException;
>   -import javax.xml.soap.SOAPElement;
>    import javax.xml.soap.DetailEntry;
>    import javax.xml.soap.Name;
>   +import javax.xml.soap.SOAPElement;
>   +import javax.xml.soap.SOAPException;
>    import java.io.IOException;
>   -import java.util.Locale;
>    import java.util.List;
>   +import java.util.Locale;
> 
>    /** A Fault body element.
>     *
> 
>   1.38      +2 -3      ws-axis/java/src/org/apache/axis/message/SOAPFaultBuilder.java
> 
>   Index: SOAPFaultBuilder.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPFaultBuilder.java,v
>   retrieving revision 1.37
>   retrieving revision 1.38
>   diff -u -r1.37 -r1.38
>   --- SOAPFaultBuilder.java     22 Jun 2004 17:42:50 -0000      1.37
>   +++ SOAPFaultBuilder.java     27 Jun 2004 12:28:31 -0000      1.38
>   @@ -29,11 +29,10 @@
> 
>    import javax.xml.namespace.QName;
>    import java.lang.reflect.Constructor;
>   -import java.util.List;
>   +import java.rmi.RemoteException;
>    import java.util.HashMap;
>   -import java.util.Vector;
>    import java.util.List;
>   -import java.rmi.RemoteException;
>   +import java.util.Vector;
> 
>    /**
>     * Build a Fault body element.
> 
>   1.20      +1 -1      ws-axis/java/src/org/apache/axis/message/SOAPFaultDetailsBuilder.java
> 
>   Index: SOAPFaultDetailsBuilder.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPFaultDetailsBuilder.java,v
>   retrieving revision 1.19
>   retrieving revision 1.20
>   diff -u -r1.19 -r1.20
>   --- SOAPFaultDetailsBuilder.java      21 Apr 2004 02:40:35 -0000      1.19
>   +++ SOAPFaultDetailsBuilder.java      27 Jun 2004 12:28:31 -0000      1.20
>   @@ -25,9 +25,9 @@
>    import org.apache.axis.encoding.DeserializationContext;
>    import org.apache.axis.encoding.Deserializer;
>    import org.apache.axis.encoding.DeserializerImpl;
>   +import org.apache.axis.soap.SOAPConstants;
>    import org.apache.axis.utils.ClassUtils;
>    import org.apache.axis.utils.Messages;
>   -import org.apache.axis.soap.SOAPConstants;
>    import org.xml.sax.Attributes;
>    import org.xml.sax.SAXException;
> 
>   1.5       +3 -3      ws-axis/java/src/org/apache/axis/message/SOAPFaultReasonBuilder.java
> 
>   Index: SOAPFaultReasonBuilder.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPFaultReasonBuilder.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- SOAPFaultReasonBuilder.java       25 Feb 2004 14:02:43 -0000      1.4
>   +++ SOAPFaultReasonBuilder.java       27 Jun 2004 12:28:31 -0000      1.5
>   @@ -1,10 +1,10 @@
>    package org.apache.axis.message;
> 
>   +import org.apache.axis.Constants;
>   +import org.apache.axis.encoding.Callback;
>   +import org.apache.axis.encoding.CallbackTarget;
>    import org.apache.axis.encoding.DeserializationContext;
>    import org.apache.axis.encoding.Deserializer;
>   -import org.apache.axis.encoding.CallbackTarget;
>   -import org.apache.axis.encoding.Callback;
>   -import org.apache.axis.Constants;
>    import org.xml.sax.Attributes;
>    import org.xml.sax.SAXException;
> 
>   1.83      +4 -18     ws-axis/java/src/org/apache/axis/message/SOAPHeader.java
> 
>   Index: SOAPHeader.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPHeader.java,v
>   retrieving revision 1.82
>   retrieving revision 1.83
>   diff -u -r1.82 -r1.83
>   --- SOAPHeader.java   22 Jun 2004 17:42:50 -0000      1.82
>   +++ SOAPHeader.java   27 Jun 2004 12:28:31 -0000      1.83
>   @@ -16,9 +16,9 @@
> 
>    package org.apache.axis.message;
> 
>   +import org.apache.axis.AxisFault;
>    import org.apache.axis.Constants;
>    import org.apache.axis.MessageContext;
>   -import org.apache.axis.AxisFault;
>    import org.apache.axis.components.logger.LogFactory;
>    import org.apache.axis.encoding.DeserializationContext;
>    import org.apache.axis.encoding.SerializationContext;
>   @@ -32,11 +32,10 @@
>    import javax.xml.soap.Name;
>    import javax.xml.soap.SOAPElement;
>    import javax.xml.soap.SOAPException;
>   -
>   -import java.util.List;
>    import java.util.ArrayList;
>    import java.util.Enumeration;
>    import java.util.Iterator;
>   +import java.util.List;
>    import java.util.Vector;
> 
>   @@ -86,13 +85,6 @@
>            }
>        }
> 
>   -    public void detachNode() {
>   -        if (parent != null) {
>   -            ((SOAPEnvelope)parent).removeHeaders();
>   -        }
>   -        super.detachNode();
>   -    }
>   -
>        public javax.xml.soap.SOAPHeaderElement addHeaderElement(Name name)
>            throws SOAPException {
>            SOAPHeaderElement headerElement = new SOAPHeaderElement(name);
>   @@ -157,15 +149,9 @@
>            return result.iterator();
>        }
> 
>   -    protected void initializeChildren() {
>   -        if (children == null) {
>   -            children = new Vector();
>   -        }
>   -    }
>   -
>        Vector getHeaders() {
>            initializeChildren();
>   -        return (Vector)getChildren();
>   +        return new Vector(getChildren());
>        }
> 
>        /**
>   @@ -217,7 +203,7 @@
>        void removeHeader(SOAPHeaderElement header) {
>            if (log.isDebugEnabled())
>                log.debug(Messages.getMessage("removeHeader00"));
>   -        removeChild((MessageElement)header);
>   +        removeChild(header);
>        }
> 
>        /**
> 
>   1.35      +1 -1      ws-axis/java/src/org/apache/axis/message/SOAPHeaderElement.java
> 
>   Index: SOAPHeaderElement.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPHeaderElement.java,v
>   retrieving revision 1.34
>   retrieving revision 1.35
>   diff -u -r1.34 -r1.35
>   --- SOAPHeaderElement.java    22 Jun 2004 17:42:50 -0000      1.34
>   +++ SOAPHeaderElement.java    27 Jun 2004 12:28:31 -0000      1.35
>   @@ -15,8 +15,8 @@
>     */
>    package org.apache.axis.message;
> 
>   -import org.apache.axis.Constants;
>    import org.apache.axis.AxisFault;
>   +import org.apache.axis.Constants;
>    import org.apache.axis.encoding.DeserializationContext;
>    import org.apache.axis.encoding.SerializationContext;
>    import org.apache.axis.soap.SOAPConstants;
> 
>   1.10      +1 -1      ws-axis/java/src/org/apache/axis/message/Text.java
> 
>   Index: Text.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/Text.java,v
>   retrieving revision 1.9
>   retrieving revision 1.10
>   diff -u -r1.9 -r1.10
>   --- Text.java 25 Feb 2004 14:02:43 -0000      1.9
>   +++ Text.java 27 Jun 2004 12:28:31 -0000      1.10
>   @@ -27,7 +27,7 @@
>     * @author Davanum Srinivas (dims@yahoo.com)
>     * @author Heejune Ahn      (cityboy@tmax.co.kr)
>     */
>   -public class Text extends MessageElement implements javax.xml.soap.Text {
>   +public class Text extends NodeImpl implements javax.xml.soap.Text {
> 
>        public Text(String s) {
>            try {
> 
>   1.1                  ws-axis/java/src/org/apache/axis/message/NodeImpl.java
> 
>   Index: NodeImpl.java
>   ===================================================================
>   /*
>    * Copyright 2001-2004 The Apache Software Foundation.
>    *
>    * Licensed under the Apache License, Version 2.0 (the "License");
>    * you may not use this file except in compliance with the License.
>    * You may obtain a copy of the License at
>    *
>    *      http://www.apache.org/licenses/LICENSE-2.0
>    *
>    * Unless required by applicable law or agreed to in writing, software
>    * distributed under the License is distributed on an "AS IS" BASIS,
>    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>    * See the License for the specific language governing permissions and
>    * limitations under the License.
>    */
> 
>   package org.apache.axis.message;
> 
>   import org.apache.axis.components.logger.LogFactory;
>   import org.apache.axis.encoding.SerializationContext;
>   import org.apache.axis.i18n.Messages;
>   import org.apache.commons.logging.Log;
>   import org.w3c.dom.Attr;
>   import org.w3c.dom.CDATASection;
>   import org.w3c.dom.CharacterData;
>   import org.w3c.dom.Comment;
>   import org.w3c.dom.DOMException;
>   import org.w3c.dom.Document;
>   import org.w3c.dom.NamedNodeMap;
>   import org.w3c.dom.Node;
>   import org.w3c.dom.NodeList;
>   import org.w3c.dom.Text;
>   import org.xml.sax.Attributes;
>   import org.xml.sax.helpers.AttributesImpl;
> 
>   import javax.xml.soap.SOAPElement;
>   import javax.xml.soap.SOAPException;
>   import java.io.Serializable;
>   import java.util.ArrayList;
>   import java.util.Iterator;
> 
>   public class NodeImpl implements org.w3c.dom.Node, javax.xml.soap.Node,
>           Serializable, Cloneable {
> 
>       protected static Log log =
>               LogFactory.getLog(NodeImpl.class.getName());
> 
>       protected String name;
>       protected String prefix;
>       protected String namespaceURI;
>       protected transient Attributes attributes = NullAttributes.singleton;
> 
>       protected org.apache.axis.SOAPPart soapPart = null;
>       protected NodeImpl parent = null;
>       protected ArrayList children = null;
> 
>       // ...or as DOM
>       protected CharacterData textRep = null;
> 
>       protected boolean   _isDirty = false;
> 
>       public NodeImpl() {
>       }
> 
>       public NodeImpl(CharacterData text) {
>           textRep = text;
>           namespaceURI = text.getNamespaceURI();
>           name = text.getLocalName();
>       }
> 
>       /**
>        * A code representing the type of the underlying object, as defined above.
>        */
>       public short getNodeType() {
>           if (this.textRep != null) {
>               if (textRep instanceof Comment) {
>                   return COMMENT_NODE;
>               } else if (textRep instanceof CDATASection) {
>                   return CDATA_SECTION_NODE;
>               } else {
>                   return TEXT_NODE;
>               }
>           } else if (false) {
>               return DOCUMENT_FRAGMENT_NODE;
>           } else if (false) {
>               return Node.ELEMENT_NODE;
>           } else { // most often but we cannot give prioeity now
>               return Node.ELEMENT_NODE;
>           }
>       }
> 
>       /**
>        * Puts all <code>Text</code> nodes in the full depth of the sub-tree
>        * underneath this <code>Node</code>, including attribute nodes, into a
>        * "normal" form where only structure (e.g., elements, comments,
>        * processing instructions, CDATA sections, and entity references)
>        * separates <code>Text</code> nodes, i.e., there are neither adjacent
>        * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can
>        * be used to ensure that the DOM view of a document is the same as if
>        * it were saved and re-loaded, and is useful when operations (such as
>        * XPointer  lookups) that depend on a particular document tree
>        * structure are to be used.In cases where the document contains
>        * <code>CDATASections</code>, the normalize operation alone may not be
>        * sufficient, since XPointers do not differentiate between
>        * <code>Text</code> nodes and <code>CDATASection</code> nodes.
>        */
>       public void normalize() {
>           //TODO: Fix this for SAAJ 1.2 Implementation
>       }
> 
>       /**
>        * Returns whether this node (if it is an element) has any attributes.
>        *
>        * @return <code>true</code> if this node has any attributes,
>        *         <code>false</code> otherwise.
>        * @since DOM Level 2
>        */
>       public boolean hasAttributes() {
>           return attributes.getLength() > 0;
>       }
> 
>       /**
>        * Returns whether this node has any children.
>        *
>        * @return <code>true</code> if this node has any children,
>        *         <code>false</code> otherwise.
>        */
>       public boolean hasChildNodes() {
>           return (children != null && !children.isEmpty());
>       }
> 
>       /**
>        * Returns the local part of the qualified name of this node.
>        * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
>        * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
>        * method, such as <code>createElement</code> from the
>        * <code>Document</code> interface, this is always <code>null</code>.
>        *
>        * @since DOM Level 2
>        */
>       public String getLocalName() {
>           return name;
>       }
> 
>       /**
>        * The namespace URI of this node, or <code>null</code> if it is
>        * unspecified.
>        * <br>This is not a computed value that is the result of a namespace
>        * lookup based on an examination of the namespace declarations in
>        * scope. It is merely the namespace URI given at creation time.
>        * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
>        * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
>        * method, such as <code>createElement</code> from the
>        * <code>Document</code> interface, this is always <code>null</code>.Per
>        * the Namespaces in XML Specification  an attribute does not inherit
>        * its namespace from the element it is attached to. If an attribute is
>        * not explicitly given a namespace, it simply has no namespace.
>        *
>        * @since DOM Level 2
>        */
>       public String getNamespaceURI() {
>           return (namespaceURI);
>       }
> 
>       /**
>        * The name of this node, depending on its type; see the table above.
>        */
>       public String getNodeName() {
>           return (prefix != null) ? prefix + ":" + name : name;
>       }
> 
>       /**
>        * The value of this node, depending on its type; see the table above.
>        * When it is defined to be <code>null</code>, setting it has no effect.
>        *
>        * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
>        * @throws org.w3c.dom.DOMException DOMSTRING_SIZE_ERR: Raised when it would return more characters than
>        *                                  fit in a <code>DOMString</code> variable on the implementation
>        *                                  platform.
>        */
>       public String getNodeValue() throws DOMException {
>           return textRep.getData();
>       }
> 
>       /**
>        * The namespace prefix of this node, or <code>null</code> if it is
>        * unspecified.
>        * <br>Note that setting this attribute, when permitted, changes the
>        * <code>nodeName</code> attribute, which holds the qualified name, as
>        * well as the <code>tagName</code> and <code>name</code> attributes of
>        * the <code>Element</code> and <code>Attr</code> interfaces, when
>        * applicable.
>        * <br>Note also that changing the prefix of an attribute that is known to
>        * have a default value, does not make a new attribute with the default
>        * value and the original prefix appear, since the
>        * <code>namespaceURI</code> and <code>localName</code> do not change.
>        * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
>        * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
>        * method, such as <code>createElement</code> from the
>        * <code>Document</code> interface, this is always <code>null</code>.
>        *
>        * @throws org.w3c.dom.DOMException INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
>        *                                  illegal character, per the XML 1.0 specification .
>        *                                  <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
>        *                                  <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
>        *                                  malformed per the Namespaces in XML specification, if the
>        *                                  <code>namespaceURI</code> of this node is <code>null</code>, if the
>        *                                  specified prefix is "xml" and the <code>namespaceURI</code> of this
>        *                                  node is different from "http://www.w3.org/XML/1998/namespace", if
>        *                                  this node is an attribute and the specified prefix is "xmlns" and
>        *                                  the <code>namespaceURI</code> of this node is different from "
>        *                                  http://www.w3.org/2000/xmlns/", or if this node is an attribute and
>        *                                  the <code>qualifiedName</code> of this node is "xmlns" .
>        * @since DOM Level 2
>        */
>       public String getPrefix() {
>           return (prefix);
>       }
> 
>       /**
>        * The value of this node, depending on its type; see the table above.
>        * When it is defined to be <code>null</code>, setting it has no effect.
>        *
>        * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
>        * @throws org.w3c.dom.DOMException DOMSTRING_SIZE_ERR: Raised when it would return more characters than
>        *                                  fit in a <code>DOMString</code> variable on the implementation
>        *                                  platform.
>        */
>       public void setNodeValue(String nodeValue) throws DOMException {
>           throw new DOMException(DOMException.NO_DATA_ALLOWED_ERR,
>                   "Cannot use TextNode.set in " + this);
>       }
> 
>       /**
>        * The namespace prefix of this node, or <code>null</code> if it is
>        * unspecified.
>        * <br>Note that setting this attribute, when permitted, changes the
>        * <code>nodeName</code> attribute, which holds the qualified name, as
>        * well as the <code>tagName</code> and <code>name</code> attributes of
>        * the <code>Element</code> and <code>Attr</code> interfaces, when
>        * applicable.
>        * <br>Note also that changing the prefix of an attribute that is known to
>        * have a default value, does not make a new attribute with the default
>        * value and the original prefix appear, since the
>        * <code>namespaceURI</code> and <code>localName</code> do not change.
>        * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
>        * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
>        * method, such as <code>createElement</code> from the
>        * <code>Document</code> interface, this is always <code>null</code>.
>        *
>        * @throws org.w3c.dom.DOMException INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
>        *                                  illegal character, per the XML 1.0 specification .
>        *                                  <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
>        *                                  <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
>        *                                  malformed per the Namespaces in XML specification, if the
>        *                                  <code>namespaceURI</code> of this node is <code>null</code>, if the
>        *                                  specified prefix is "xml" and the <code>namespaceURI</code> of this
>        *                                  node is different from "http://www.w3.org/XML/1998/namespace", if
>        *                                  this node is an attribute and the specified prefix is "xmlns" and
>        *                                  the <code>namespaceURI</code> of this node is different from "
>        *                                  http://www.w3.org/2000/xmlns/", or if this node is an attribute and
>        *                                  the <code>qualifiedName</code> of this node is "xmlns" .
>        * @since DOM Level 2
>        */
>       public void setPrefix(String prefix) {
>           this.prefix = prefix;
>       }
> 
>       /**
>        * Set the owner document
>        *
>        * @param sp
>        */
>       public void setOwnerDocument(org.apache.axis.SOAPPart sp) {
>           soapPart = sp;
>       }
> 
>       /**
>        * The <code>Document</code> object associated with this node. This is
>        * also the <code>Document</code> object used to create new nodes. When
>        * this node is a <code>Document</code> or a <code>DocumentType</code>
>        * which is not used with any <code>Document</code> yet, this is
>        * <code>null</code>.
>        */
>       public Document getOwnerDocument() {
>           return soapPart;
>       }
> 
>       /**
>        * A <code>NamedNodeMap</code> containing the attributes of this node (if
>        * it is an <code>Element</code>) or <code>null</code> otherwise.
>        */
>       public NamedNodeMap getAttributes() {
>           // make first it is editable.
>           makeAttributesEditable();
>           return convertAttrSAXtoDOM(attributes);
>       }
> 
>       /**
>        * The first child of this node. If there is no such node, this returns
>        * <code>null</code>.
>        */
>       public Node getFirstChild() {
>           if (children != null && !children.isEmpty()) {
>               return (Node) children.get(0);
>           } else {
>               return null;
>           }
>       }
> 
>       /**
>        * The last child of this node. If there is no such node, this returns
>        * <code>null</code>.
>        */
>       public Node getLastChild() {
>           if (children != null && !children.isEmpty()) {
>               return (Node) children.get(children.size() - 1);
>           } else {
>               return null;
>           }
>       }
> 
>       /**
>        * The node immediately following this node. If there is no such node,
>        * this returns <code>null</code>.
>        */
>       public Node getNextSibling() {
>           SOAPElement parent = getParentElement();
>           if (parent == null) {
>               return null;
>           }
>           Iterator iter = parent.getChildElements();
>           Node nextSibling = null;
>           while (iter.hasNext()) {
>               if (iter.next().equals(this)) {
>                   if (iter.hasNext()) {
>                       return (Node) iter.next();
>                   } else {
>                       return null;
>                   }
>               }
>           }
>           return nextSibling; // should be null.
>       }
> 
>       /**
>        * The parent of this node. All nodes, except <code>Attr</code>,
>        * <code>Document</code>, <code>DocumentFragment</code>,
>        * <code>Entity</code>, and <code>Notation</code> may have a parent.
>        * However, if a node has just been created and not yet added to the
>        * tree, or if it has been removed from the tree, this is
>        * <code>null</code>.
>        */
>       public Node getParentNode() {
>           return parent;
>       }
> 
>       /**
>        * The node immediately preceding this node. If there is no such node,
>        * this returns <code>null</code>.
>        */
>       public Node getPreviousSibling() {
>           SOAPElement parent = getParentElement();
>           Iterator iter = parent.getChildElements();
>           Node previousSibling = null;
>           while (iter.hasNext()) {
>               if (iter.next().equals(this)) {
>                   return previousSibling;
>               }
>           }
>           return previousSibling; // should be null.
>       }
> 
>       /**
>        * Returns a duplicate of this node, i.e., serves as a generic copy
>        * constructor for nodes. The duplicate node has no parent; (
>        * <code>parentNode</code> is <code>null</code>.).
>        * <br>Cloning an <code>Element</code> copies all attributes and their
>        * values, including those generated by the XML processor to represent
>        * defaulted attributes, but this method does not copy any text it
>        * contains unless it is a deep clone, since the text is contained in a
>        * child <code>Text</code> node. Cloning an <code>Attribute</code>
>        * directly, as opposed to be cloned as part of an <code>Element</code>
>        * cloning operation, returns a specified attribute (
>        * <code>specified</code> is <code>true</code>). Cloning any other type
>        * of node simply returns a copy of this node.
>        * <br>Note that cloning an immutable subtree results in a mutable copy,
>        * but the children of an <code>EntityReference</code> clone are readonly
>        * . In addition, clones of unspecified <code>Attr</code> nodes are
>        * specified. And, cloning <code>Document</code>,
>        * <code>DocumentType</code>, <code>Entity</code>, and
>        * <code>Notation</code> nodes is implementation dependent.
>        *
>        * @param deep If <code>true</code>, recursively clone the subtree under
>        *             the specified node; if <code>false</code>, clone only the node
>        *             itself (and its attributes, if it is an <code>Element</code>).
>        * @return The duplicate node.
>        */
>       public Node cloneNode(boolean deep) {
>           return new NodeImpl(textRep);
>       }
> 
>       /**
>        * A <code>NodeList</code> that contains all children of this node. If
>        * there are no children, this is a <code>NodeList</code> containing no
>        * nodes.
>        */
>       public NodeList getChildNodes() {
>           return new NodeListImpl(children);
>       }
> 
>       /**
>        * Tests whether the DOM implementation implements a specific feature and
>        * that feature is supported by this node.
>        *
>        * @param feature The name of the feature to test. This is the same name
>        *                which can be passed to the method <code>hasFeature</code> on
>        *                <code>DOMImplementation</code>.
>        * @param version This is the version number of the feature to test. In
>        *                Level 2, version 1, this is the string "2.0". If the version is not
>        *                specified, supporting any version of the feature will cause the
>        *                method to return <code>true</code>.
>        * @return Returns <code>true</code> if the specified feature is
>        *         supported on this node, <code>false</code> otherwise.
>        * @since DOM Level 2
>        */
>       public boolean isSupported(String feature, String version) {
>           return false;  //TODO: Fix this for SAAJ 1.2 Implementation
>       }
> 
>       /**
>        * Adds the node <code>newChild</code> to the end of the list of children
>        * of this node. If the <code>newChild</code> is already in the tree, it
>        * is first removed.
>        *
>        * @param newChild The node to add.If it is a
>        *                 <code>DocumentFragment</code> object, the entire contents of the
>        *                 document fragment are moved into the child list of this node
>        * @return The node added.
>        * @throws org.w3c.dom.DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
>        *                                  allow children of the type of the <code>newChild</code> node, or if
>        *                                  the node to append is one of this node's ancestors or this node
>        *                                  itself.
>        *                                  <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
>        *                                  from a different document than the one that created this node.
>        *                                  <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
>        *                                  if the previous parent of the node being inserted is readonly.
>        */
>       public Node appendChild(Node newChild) throws DOMException {
>           initializeChildren();
>           children.add(newChild);
>           return newChild;
>       }
> 
>       /**
>        * Removes the child node indicated by <code>oldChild</code> from the list
>        * of children, and returns it.
>        *
>        * @param oldChild The node being removed.
>        * @return The node removed.
>        * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
>        *                                  <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
>        *                                  this node.
>        */
>       public Node removeChild(Node oldChild) throws DOMException {
>           boolean removed = false;
>           initializeChildren();
>           int position = children.indexOf(oldChild);
>           if (position < 0) {
>               throw new DOMException(DOMException.NOT_FOUND_ERR,
>                       "NodeImpl Not found");
>           }
> 
>           while (position != -1) {
>               children.remove(position);
>               removed = true;
>               position = children.indexOf(oldChild);
>           }
>           if (removed) {
>               setDirty(removed);
>           }
> 
>           return oldChild;
>       }
> 
>       /**
>        * Inserts the node <code>newChild</code> before the existing child node
>        * <code>refChild</code>. If <code>refChild</code> is <code>null</code>,
>        * insert <code>newChild</code> at the end of the list of children.
>        * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
>        * all of its children are inserted, in the same order, before
>        * <code>refChild</code>. If the <code>newChild</code> is already in the
>        * tree, it is first removed.
>        *
>        * @param newChild The node to insert.
>        * @param refChild The reference node, i.e., the node before which the
>        *                 new node must be inserted.
>        * @return The node being inserted.
>        * @throws org.w3c.dom.DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
>        *                                  allow children of the type of the <code>newChild</code> node, or if
>        *                                  the node to insert is one of this node's ancestors or this node
>        *                                  itself.
>        *                                  <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
>        *                                  from a different document than the one that created this node.
>        *                                  <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
>        *                                  if the parent of the node being inserted is readonly.
>        *                                  <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
>        *                                  this node.
>        */
>       public Node insertBefore(Node newChild, Node refChild) throws DOMException {
>           initializeChildren();
>           int position = children.indexOf(refChild);
>           if (position < 0) {
>               position = 0;
>           }
>           children.add(position, newChild);
>           return newChild;
>       }
> 
>       /**
>        * Replaces the child node <code>oldChild</code> with <code>newChild</code>
>        * in the list of children, and returns the <code>oldChild</code> node.
>        * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
>        * <code>oldChild</code> is replaced by all of the
>        * <code>DocumentFragment</code> children, which are inserted in the
>        * same order. If the <code>newChild</code> is already in the tree, it
>        * is first removed.
>        *
>        * @param newChild The new node to put in the child list.
>        * @param oldChild The node being replaced in the list.
>        * @return The node replaced.
>        * @throws org.w3c.dom.DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
>        *                                  allow children of the type of the <code>newChild</code> node, or if
>        *                                  the node to put in is one of this node's ancestors or this node
>        *                                  itself.
>        *                                  <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
>        *                                  from a different document than the one that created this node.
>        *                                  <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of
>        *                                  the new node is readonly.
>        *                                  <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
>        *                                  this node.
>        */
>       public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
>           initializeChildren();
>           int position = children.indexOf(oldChild);
>           if (position < 0) {
>               throw new DOMException(DOMException.NOT_FOUND_ERR,
>                       "NodeImpl Not found");
>           }
>           children.remove(position);
>           children.add(position, newChild);
>           return oldChild;
>       }
> 
>       /**
>        * Returns the the value of the immediate child of this <code>Node</code>
>        * object if a child exists and its value is text.
>        *
>        * @return a <code>String</code> with the text of the immediate child of
>        *         this <code>Node</code> object if (1) there is a child and
>        *         (2) the child is a <code>Text</code> object;
>        *         <code>null</code> otherwise
>        */
>       public String getValue() {
>           return textRep.getNodeValue();
>       }
> 
>       /**
>        * Sets the parent of this <code>Node</code> object to the given
>        * <code>SOAPElement</code> object.
>        *
>        * @param parent the <code>SOAPElement</code> object to be set as
>        *               the parent of this <code>Node</code> object
>        * @throws javax.xml.soap.SOAPException if there is a problem in setting the
>        *                                      parent to the given element
>        * @see #getParentElement() getParentElement()
>        */
>       public void setParentElement(SOAPElement parent) throws SOAPException {
>           if (parent == null)
>               throw new IllegalArgumentException(
>                       Messages.getMessage("nullParent00"));
>           try {
>               setParent((NodeImpl) parent);
>           } catch (Throwable t) {
>               throw new SOAPException(t);
>           }
>       }
> 
>       /**
>        * Returns the parent element of this <code>Node</code> object.
>        * This method can throw an <code>UnsupportedOperationException</code>
>        * if the tree is not kept in memory.
>        *
>        * @return the <code>SOAPElement</code> object that is the parent of
>        *         this <code>Node</code> object or <code>null</code> if this
>        *         <code>Node</code> object is root
>        * @throws UnsupportedOperationException if the whole tree is not kept in memory
>        * @see #setParentElement(javax.xml.soap.SOAPElement) setParentElement(javax.xml.soap.SOAPElement)
>        */
>       public SOAPElement getParentElement() {
>           return (SOAPElement) getParent();
>       }
> 
>       /**
>        * Removes this <code>Node</code> object from the tree. Once
>        * removed, this node can be garbage collected if there are no
>        * application references to it.
>        */
>       public void detachNode() {
>           if (parent != null) {
>               parent.removeChild(this);
>               parent = null;
>           }
>       }
> 
>       /**
>        * Notifies the implementation that this <code>Node</code>
>        * object is no longer being used by the application and that the
>        * implementation is free to reuse this object for nodes that may
>        * be created later.
>        * <P>
>        * Calling the method <code>recycleNode</code> implies that the method
>        * <code>detachNode</code> has been called previously.
>        */
>       public void recycleNode() {
>           //TODO: Fix this for SAAJ 1.2 Implementation
>       }
> 
>       /**
>        * If this is a Text node then this method will set its value, otherwise it
>        * sets the value of the immediate (Text) child of this node. The value of
>        * the immediate child of this node can be set only if, there is one child
>        * node and that node is a Text node, or if there are no children in which
>        * case a child Text node will be created.
>        *
>        * @param value the text to set
>        * @throws IllegalStateException if the node is not a Text  node and
>        *                               either has more than one child node or has a child node that
>        *                               is not a Text node
>        */
>       public void setValue(String value) {
>           if (this instanceof org.apache.axis.message.Text) {
>               this.setNodeValue(value);
>               return;
>           }
>           if (children != null)
>               for (int i = 0; i < children.size(); i++) {
>                   NodeImpl child = (NodeImpl) children.get(i);
>                   if (child instanceof org.apache.axis.message.Text) {
>                       child.setValue(value);
>                       return;
>                   }
>               }
>           throw new IllegalStateException("Cannot call set for Non Text Node");
>       }
> 
>       /**
>        * make the attributes editable
>        *
>        * @return AttributesImpl
>        */
>       protected AttributesImpl makeAttributesEditable() {
>           if (attributes == null || attributes instanceof NullAttributes) {
>               attributes = new AttributesImpl();
>           } else if (!(attributes instanceof AttributesImpl)) {
>               attributes = new AttributesImpl(attributes);
>           }
>           return (AttributesImpl) attributes;
>       }
> 
>       /**
>        * The internal representation of Attributes cannot help being changed
>        * It is because Attribute is not immutible Type, so if we keep out value and
>        * just return it in another form, the application may chnae it, which we cannot
>        * detect without some kind back track method (call back notifying the chnage.)
>        * I am not sure which approach is better.
>        */
>       protected NamedNodeMap convertAttrSAXtoDOM(Attributes saxAttr) {
>           try {
>               org.w3c.dom.Document doc = org.apache.axis.utils.XMLUtils.newDocument();
>               AttributesImpl saxAttrs = (AttributesImpl) saxAttr;
>               NamedNodeMap domAttributes = new NamedNodeMapImpl();
>               for (int i = 0; i < saxAttrs.getLength(); i++) {
>                   String uri = saxAttrs.getURI(i);
>                   String qname = saxAttrs.getQName(i);
>                   String value = saxAttrs.getValue(i);
>                   if (uri != null && uri.trim().length() > 0) {
>                       // filterring out the tricky method to differentiate the null namespace
>                       // -ware case
>                       if (uri.equals("intentionalNullURI")) {
>                           uri = null;
>                       }
>                       Attr attr = doc.createAttributeNS(uri, qname);
>                       attr.setValue(value);
>                       domAttributes.setNamedItemNS(attr);
>                   } else {
>                       Attr attr = doc.createAttribute(qname);
>                       attr.setValue(value);
>                       domAttributes.setNamedItem(attr);
>                   }
>               }
>               return domAttributes;
>           } catch (Exception ex) {
>               ex.printStackTrace();
>               return null;
>           }
>       }
> 
>       /**
>        * Initialize the children array
>        */
>       protected void initializeChildren() {
>           if (children == null) {
>               children = new ArrayList();
>           }
>       }
> 
>       /**
>        * get the parent node
>        * @return parent node
>        */
>       protected NodeImpl getParent() {
>           return parent;
>       }
> 
>       /**
>        * set the parent node
>        * @param parent
>        * @throws SOAPException
>        */
>       protected void setParent(NodeImpl parent) throws SOAPException {
>           if (this.parent == parent) {
>               return;
>           }
>           if (this.parent != null) {
>               this.parent.removeChild(this);
>           }
>           if (parent != null) {
>               parent.appendChild(this);
>           }
>           this.parent = parent;
>       }
> 
>       /**
>        * print the contents of this node
>        * @param context
>        * @throws Exception
>        */
>       public void output(SerializationContext context) throws Exception {
>           if (textRep == null)
>               return;
>           boolean oldPretty = context.getPretty();
>           context.setPretty(false);
>           if (textRep instanceof CDATASection) {
>               context.writeString("<![CDATA[");
>               context.writeString(((org.w3c.dom.Text) textRep).getData());
>               context.writeString("]]>");
>           } else if (textRep instanceof Comment) {
>               context.writeString("<!--");
>               context.writeString(((CharacterData) textRep).getData());
>               context.writeString("-->");
>           } else if (textRep instanceof Text) {
>               context.writeSafeString(((Text) textRep).getData());
>           }
>           context.setPretty(oldPretty);
>       }
> 
>       public boolean isDirty() { return _isDirty; }
> 
>       public void setDirty(boolean dirty)
>       {
>           _isDirty = dirty;
>           if (_isDirty && parent != null) {
>               ((NodeImpl)parent).setDirty(true);
>           }
>       }
> 
>   }
> 
>   1.21      +1 -1      ws-axis/java/test/wsdl/extensibility/ExtensibilityQueryBindingImpl.java
> 
>   Index: ExtensibilityQueryBindingImpl.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/test/wsdl/extensibility/ExtensibilityQueryBindingImpl.java,v
>   retrieving revision 1.20
>   retrieving revision 1.21
>   diff -u -r1.20 -r1.21
>   --- ExtensibilityQueryBindingImpl.java        27 Mar 2004 11:47:55 -0000      1.20
>   +++ ExtensibilityQueryBindingImpl.java        27 Jun 2004 12:28:31 -0000      1.21
>   @@ -129,7 +129,7 @@
>            book.setSubject("gotAll");
>            QName elementName = _FindBooksQueryExpressionElement.getTypeDesc().getFields()[0].getXmlName();
>            replyElements[0] = new MessageElement(elementName.getNamespaceURI(), elementName.getLocalPart(), book);
>   -        replyElements[1] = new Text("ABCD");
>   +        replyElements[1] = new MessageElement(new Text("ABCD"));
> 
>            reply.set_any(replyElements);
> 
>   1.23      +3 -3      ws-axis/java/test/wsdl/extensibility/ExtensibilityQueryTestCase.java
> 
>   Index: ExtensibilityQueryTestCase.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/test/wsdl/extensibility/ExtensibilityQueryTestCase.java,v
>   retrieving revision 1.22
>   retrieving revision 1.23
>   diff -u -r1.22 -r1.23
>   --- ExtensibilityQueryTestCase.java   27 Mar 2004 11:47:55 -0000      1.22
>   +++ ExtensibilityQueryTestCase.java   27 Jun 2004 12:28:31 -0000      1.23
>   @@ -97,15 +97,15 @@
> 
>                MessageElement [] elements = new MessageElement[4];
> 
>   -            elements[0] = new Text("123");
>   -            elements[1] = new Text("  456");
>   +            elements[0] = new MessageElement(new Text("123"));
>   +            elements[1] = new MessageElement(new Text("  456"));
> 
>                BookType book = new BookType();
>                book.setSubject("all");
>                QName elementName = _FindBooksQueryExpressionElement.getTypeDesc().getFields()[0].getXmlName();
>                elements[2] = new MessageElement(elementName.getNamespaceURI(), elementName.getLocalPart(), book);
> 
>   -            elements[3] = new Text("789");
>   +            elements[3] = new MessageElement(new Text("789"));
> 
>                expression.set_any(elements);
> 
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Mime
View raw message