On Wed, 2006-05-31 at 11:26 -0400, Mona Yazbeck wrote:
> Hello
>
> I started parsing my XML to DOM, but then, even if I create a new message
> element with the root of the DOM, I will get an error, because it seems like
> I really need a MessageElement as an array since the contructor of my other
> method is:
>
> public UpdateListItemsUpdates(org.apache.axis.message.MessageElement []
> _any) {
> this._any = _any;
> }
>
> So then, how can I put my XML file in an array of MessageElement?
>
> <Method ID='1' Cmd='New'>
> <Field Name='Title'>Nom</Field>
> <Field Name='FirstName'>Prenom</Field>
> <Field Name='Email'>[EMAIL PROTECTED]</Field>
> </Method>
>
> I tried this way:
>
> org.apache.axis.message.MessageElement[] xbatch = new
> org.apache.axis.message.MessageElement[3];
> xbatch[0] = new org.apache.axis.message.MessageElement(new
> javax.xml.namespace.QName("Title"),"Last Name");
> xbatch[1] = new org.apache.axis.message.MessageElement(new
> javax.xml.namespace.QName("FirstName"),"First Name");
> xbatch[2] = new org.apache.axis.message.MessageElement(new
> javax.xml.namespace.QName("Email"),"Email");
>
> but I don't know how to put the root element in this kind of structure...
I was more thinking of parsing the XML in a string, using a
DocumentBuilder, which yields a document with a single root Element (the
Method element), you wrap that one in a MessageElement with
me = new MessageElement(root);
and use that one as the parameter updateListItems().
of course you can construct the DOM tree manually as you intended to do
above, but then create the root message element, add the child elements
to it and don't forget about the attributes...
regards,
jaKa
--
email: [EMAIL PROTECTED]
w3: http://fish.homeunix.org/people/jaka/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]