You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2003/03/18 21:01:22 UTC

cvs commit: xml-axis/java/src/org/apache/axis/message MessageElement.java

dims        2003/03/18 12:01:22

  Modified:    java/src/org/apache/axis/message MessageElement.java
  Log:
  Fix for test.saaj.TestEnvelope.testAttributes failure.
  
  Revision  Changes    Path
  1.149     +12 -2     xml-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.148
  retrieving revision 1.149
  diff -u -r1.148 -r1.149
  --- MessageElement.java	3 Mar 2003 15:11:52 -0000	1.148
  +++ MessageElement.java	18 Mar 2003 20:01:21 -0000	1.149
  @@ -620,6 +620,13 @@
                                   value);
       }
   
  +    public void addAttribute(String prefix, String namespace, String localName,
  +                             String value)
  +    {
  +        AttributesImpl attributes = makeAttributesEditable();
  +        attributes.addAttribute(namespace, localName, prefix, "CDATA",
  +                                value);
  +    }
       /**
        * Set an attribute, adding the attribute if it isn't already present
        * in this element, and changing the value if it is.  Passing null as the
  @@ -961,7 +968,7 @@
       public SOAPElement addAttribute(Name name, String value)
           throws SOAPException {
           try {
  -            addAttribute(name.getURI(), name.getLocalName(), value);
  +            addAttribute(name.getPrefix(), name.getURI(), name.getLocalName(), value);
           } catch (RuntimeException t) {
               throw new SOAPException(t);
           }
  @@ -992,8 +999,11 @@
               String prefix = "";
               if (q != null) {
                   int idx = q.indexOf(":");
  -                if (idx > 0)
  +                if (idx > 0) {
                       prefix = q.substring(0, idx);
  +                } else {
  +                    prefix= q;
  +                }
               }
   
               attrs.add(new PrefixedQName(attributes.getURI(i),