This is unfortunate.
I got tired of custom XML decoding and wanted to use SimpleXMLDecoder +
Darron Schall's ObjectTranslator.
But SimpleXMLDecoder expects an XMLNode not an XML or XMLList

The technique described here is a possibility (perhaps my best option),
except I don't wish to decode the entire XML returned at once:

http://booleanbetrayal.com/2007/05/18/httpservice-xmldecode-objecttranslator-and-rabidsquirrels/

Converting an XML  to an XMLDocument via a string seems like a really bad
example to show people:

http://blog.flexexamples.com/2007/09/19/converting-xml-to-objects-using-the-flex-simplexmldecoder-class/

Any good new solutions out there?


On Fri, Aug 15, 2008 at 7:35 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

>    I recommend custom conversion whether with static factory methods or
> something more brute force, although it might depend a bit on whether you're
> round-tripping the xml.  If you're not, and are going to be hitting
> attributes in the nodes frequently, it will probably pay to convert the node
> from xml to class instance, especially if you don't need all of the
> attributes.  Some webservices return a lot of data per-item that I'm just
> going to ignore and a generic XML walker iterates all the nodes and
> attributes while a custom one can pick and choose the few things it might
> need.
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Richard Rodseth
> *Sent:* Friday, August 15, 2008 5:07 PM
> *To:* [email protected]
> *Subject:* Re: [flexcoders] XML Decoding
>
>
>
> Not yet, though I saw a reference to that in my Googling. I think I'm just
> going to hold my nose gently and make static factory methods that take an
> XML argument. I've been experimenting with the XML-backed idea and that's
> not too bad either.
>
> Harder to switch between XML and AMF I guess, but KISS applies too. Unless
> there's a good library out there yet to be revealed.
>
> On Fri, Aug 15, 2008 at 5:03 PM, Tracy Spratt <[EMAIL PROTECTED]>
> wrote:
>
> Have you looked at the Flex 3 functionality that reads the webservice wsdl
> and generates code for strongly typed access?
>
>
>
> It was way too complicated for my needs but might help answer your
> questions.
>
> Tracy
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Richard Rodseth
> *Sent:* Friday, August 15, 2008 5:12 PM
> *To:* [email protected]
> *Subject:* [flexcoders] XML Decoding
>
>
>
> What's the latest and greatest on XML Decoding?
>
> Reading the blogs and docs, it looks as though SimpleXMLDecoder +
> ObjectTranslator is one approach, but seems to rely on (deprecated?)
> XMLDocument and is not schema-aware.
>
> I've also considered defining some interfaces and providing XML-backed
> implementations that would point back to the nodes in the original DOM,
> perhaps with binding support and caching of the typed objects. But I think
> I'd just prefer a nice clean way to convert the whole structure to typed
> objects, and then throw the XML away.
>
> Any recommendations?
>
>
>
>  
>

Reply via email to