Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 74012 invoked from network); 16 Nov 2006 16:51:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Nov 2006 16:51:19 -0000 Received: (qmail 985 invoked by uid 500); 16 Nov 2006 16:51:19 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 969 invoked by uid 500); 16 Nov 2006 16:51:19 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 945 invoked by uid 99); 16 Nov 2006 16:51:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 08:51:19 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [66.46.107.253] (HELO mail.allstreamits.com) (66.46.107.253) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 08:51:04 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7099F.8C102740" Subject: [Axis2] getAttribute call for OMElement Date: Thu, 16 Nov 2006 11:50:47 -0500 Message-ID: <86DF2883EC684A4C9043EE18340521FA0325091F@EX0004.AllstreamITS.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Axis2] getAttribute call for OMElement Thread-Index: AccJn10teH8isYSHQx+QBS14FmiYdA== From: "Vietchau Nguyen" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C7099F.8C102740 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi all, =20 I have a simple call to getAttribute and I can't seem to call it properly. I can use getAllAttributes() to get all of the attributes and then go through them to find the one I'm looking for but it's not efficient, and so any help is appreciated. I think I just miss something very simple but I can't find it in any sample or questions. =20 Here is my code with getAllAttributes() =20 =20 OMElement element; Iterator OMAttIter =3D element.getAllAttributes(); while (OMAttIter.hasNext()) { OMAttribute attri =3D OMAttIter.next(); System.out.println(attri.getLocalName() + ": "+ attri.getAttributeValue()); } =20 Here is the result from the above code: =20 arrayType: ns1:Language[2] type: ns1:ArrayOfLanguage Now, I want to call getAttribute, say "type" for example, and here is my code: =20 OMAttribute attri =3D element.getAttribute(new QName("type")); =20 It didn't work (I get a null return), so next I tried the 2 following cases: =20 OMAttribute arrayType =3D element.getAttribute(new QName("xsi", = "type")); =20 and=20 =20 OMAttribute attri =3D element.getAttribute(new QName(Constants.ATTR_TYPE)); =20 They didn't work either. I always get a null return. So, I don't know what to try next. Can anyone help me out how to call this function? =20 My goal actually is to find (1) whether it's an array, and if yes, (2) what is the size... so if there is any other way to find out these information, please advise me. =20 Thanks in advance for your help, Vietchau =20 =20 ------_=_NextPart_001_01C7099F.8C102740 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi all,

 

I have a simple call to getAttribute and I = can’t seem to call it properly. I can use getAllAttributes() to get all of the = attributes and then go through them to find the one I’m looking for but = it’s not efficient, and so any help is appreciated. I think I just miss = something very simple but I can’t find it in any sample or = questions.

 

Here is my code with = getAllAttributes()

 

 

OMElement element;

Iterator<OMAttribute> OMAttIter =3D element.getAllAttributes();

        while (OMAttIter.hasNext()) {

         =    OMAttribute attri =3D OMAttIter.next();

         =    System.out.println(attri.getLocalName() + ": "+  attri.getAttributeValue());

        = }

 

Here is the result from the above = code:

 

arrayType: = ns1:Language[2]

type: = ns1:ArrayOfLanguage

Now, I want to call getAttribute, say = “type” for example, and here is my code:

 

OMAttribute attri =3D element.getAttribute(new = QName(“type”));

 

It didn’t work (I get a null return), so next I = tried the 2 following cases:

 

OMAttribute arrayType =3D element.getAttribute(new QName("xsi", "type"));

 

and

 

OMAttribute attri =3D element.getAttribute(new QName(Constants.ATTR_TYPE));

 

They didn’t work either. I always get a null = return. So, I don’t know what to try next. Can anyone help me out how to call = this function?

 

My goal actually is to find (1) whether it’s an = array, and if yes, (2) what is the size… so if there is any other way to = find out these information, please advise me.

 

Thanks in advance for your = help,

Vietchau

 

 

------_=_NextPart_001_01C7099F.8C102740--