On 19 July 2010 12:16,  <[email protected]> wrote:
> Message: 6
> Date: Mon, 19 Jul 2010 21:15:54 +0200
> From: Norbert Hartl <[email protected]>
> Subject: Re: [Pharo-project] XML Demarshalling
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=us-ascii
>
>
> On 16.07.2010, at 18:46, Larry Gadallah wrote:
>
>> Hi all:
>>
>> I am a noob searching for an example of how to demarshall a set of
>> simple and complex XML nodes into an object using Pastell or something
>> similar. I have found many examples of how to pick out all of the
>> elements of a certain type into a collection, but I'm trying to grab
>> the data from a mixed collection of (~20) elements that are children
>> of a particular element type and unpack them into an object.
>>
>> Does anyone know of some good examples of how to do this using Pastell
>> or something similar?
>>
> Can you give more detailled information about how the XML maps onto the data 
> model? I mean if you have childr elements will that map to objects that are 
> referenced similar? Do attributes map to variables and such? Or do you want 
> to freely define how the structure of the XML resembles into your objects?
>
> Norbert

Hi Norbert:

Alas, I am laboring under the burden of being a newbie to both Pharo
and XML. It seems to me that it would be better to be able to
dynamically pick up all of the child elements of an element of
interest, however, I can't imagine how to define an object that
doesn't know it's own contents until run-time. In addition, in my
case, some of the child elements are complex (i.e. they also contain
children) which complicates the traversal a little bit. I'm assuming
for now that I will have to read the source XML, define the instance
variables of my object based on them, and simply populate them at run
time by traversing the XML tree. If the XML model changes, the object
definition will have to change too.

Thanks,
-- 
Larry Gadallah, VE6VQ/W7                          lgadallah AT gmail DOT com
PGP Sig: 917E DDB7 C911 9EC1 0CD9  C06B 06C4 835F 0BB8 7336

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to