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 Glen Daniels <gd...@macromedia.com> on 2002/01/31 23:10:48 UTC
RE: cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser Ar
raySerializer.java
No problemo. Onwards, onwards!
> -----Original Message-----
> From: R J Scheuerle Jr [mailto:scheu@us.ibm.com]
> Sent: Thursday, January 31, 2002 4:55 PM
> To: axis-dev@xml.apache.org
> Subject: Re: cvs commit:
> xml-axis/java/src/org/apache/axis/encoding/ser
> ArraySerializer.java
>
>
> Thanks for repairing this code.
>
> Rich Scheuerle
> XML & Web Services Development
> 512-838-5115 (IBM TL 678-5115)
>
>
>
>
> gdaniels@apache.o
>
> rg To:
> xml-axis-cvs@apache.org
>
> cc:
>
> 01/31/2002 03:52 Subject: cvs
> commit: xml-axis/java/src/org/apache/axis/encoding/ser
> PM
> ArraySerializer.java
>
> Please respond to
>
> axis-dev
>
>
>
>
>
>
>
>
> gdaniels 02/01/31 13:52:19
>
> Modified: java/src/org/apache/axis/encoding/ser
> ArraySerializer.java
> Log:
> Clean up code a bit differently, to really solve Xerces 1.4.0 issue.
>
> Revision Changes Path
> 1.4 +27 -24
> xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
>
> Index: ArraySerializer.java
> ===================================================================
> RCS file:
> /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/Array
> Serializer.java,v
>
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- ArraySerializer.java 31 Jan 2002 18:33:29 -0000
> 1.3
> +++ ArraySerializer.java 31 Jan 2002 21:52:19 -0000
> 1.4
> @@ -209,35 +209,38 @@
> }
> }
>
> - Attributes attrs = attributes;
> -
> + AttributesImpl attrs;
> if (attributes != null) {
> - AttributesImpl attrImpl = null;
> -
> - if (attributes.getIndex(Constants.URI_CURRENT_SOAP_ENC,
> -
> Constants.ATTR_ARRAY_TYPE) == -1) {
> - String encprefix =
> context.getPrefixForURI(Constants.URI_CURRENT_SOAP_ENC);
> - attrImpl = new AttributesImpl(attributes);
> -
> attrImpl.addAttribute(Constants.URI_CURRENT_SOAP_ENC,
> - Constants.ATTR_ARRAY_TYPE,
> - encprefix + ":arrayType",
> - "CDATA",
> - arrayType);
> - attrs = attrImpl;
> + if (attributes instanceof AttributesImpl) {
> + attrs = (AttributesImpl)attributes;
> + } else {
> + attrs = new AttributesImpl(attributes);
> }
> + } else {
> + attrs = new AttributesImpl();
> + }
>
> - // Force type to be SOAP_ARRAY for all array
> serialization.
> - int typeI =
> attributes.getIndex(Constants.URI_CURRENT_SCHEMA_XSI,
> - "type");
> - if (typeI != -1) {
> - if (attrImpl == null)
> - attrImpl = new AttributesImpl(attributes);
> - attrImpl.removeAttribute(typeI);
> - attrs = context.setTypeAttribute(attrImpl,
> Constants.SOAP_ARRAY);
> - }
> + if (attrs.getIndex(Constants.URI_CURRENT_SOAP_ENC,
> + Constants.ATTR_ARRAY_TYPE) == -1) {
> + String encprefix =
> context.getPrefixForURI(Constants.URI_CURRENT_SOAP_ENC);
> + attrs.addAttribute(Constants.URI_CURRENT_SOAP_ENC,
> + Constants.ATTR_ARRAY_TYPE,
> + encprefix + ":arrayType",
> + "CDATA",
> + arrayType);
> + }
> +
> + // Force type to be SOAP_ARRAY for all array serialization.
> + int typeI =
> attrs.getIndex(Constants.URI_CURRENT_SCHEMA_XSI,
> + "type");
> + if (typeI != -1) {
> + attrs.removeAttribute(typeI);
> + attributes = context.setTypeAttribute(attrs,
> Constants.SOAP_ARRAY);
> + } else {
> + attributes = attrs;
> }
>
> - context.startElement(name, attrs);
> + context.startElement(name, attributes);
>
> if (dim2Len < 0) {
> // Normal case, serialize each array element
>
>
>
>
>
>