tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/562-xml-parsingRobotlegs: Discussion 2018-10-18T16:35:27Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T11:40:04Z2011-05-26T11:40:04ZXML Parsing<div><p>You've got it exactly right there. And yes - the benefit, as you
say, is in the parser being a short lived stateless object. I
wasn't necessarily saying that that parsing itself should be done
within the code in the command, but you could initiate the parser,
give it the xml, get the result and then continue, all within the
execute() - so that the service is totally agnostic about what
happens to data once loaded.</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T11:49:37Z2011-05-26T11:49:37ZXML Parsing<div><p>That sounds like a good idea to me, fine to hear it from you so
I know I was on the right track !</p>
<p>That concludes my mid-day questions,</p>
<p>Thanks</p></div>thomas.thorstenssontag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T13:16:11Z2011-05-26T13:16:11ZXML Parsing<div><p>Another question arrives</p>
<p>Once sService loaded xml, how would I Get the xml object across
?</p>
<p>If now my xml parsing Command calls class that does the parsing
(and within execute get's the parsed xml back) it seems:</p>
<p>The command should be able to grab the unparsed xml object as a
payload of the event that triggers it ? before putting it across to
the xml parsing class.</p>
<p>Or<br>
Should my parsing class have service injected to it and look for
the loaded xml from a getter in Service (but Services should not
have getters).</p></div>thomas.thorstenssontag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T13:23:59Z2011-05-26T13:23:59ZXML Parsing<div><p>I'd go for passing the XML on the event - as you say, Services
shouldn't have persistent state as there's a possibility of getting
out of sync.</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T13:33:26Z2011-05-26T13:33:26ZXML Parsing<div><p>Yes, if not using Signals here, how would my Command get hold of
the XML. Might be silly question but cant figure it out. Since the
Command is about to do its talking to my XMLParser class within the
Commans execute method,...How do I get the xml into that
method....</p></div>thomas.thorstenssontag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T13:34:16Z2011-05-26T13:34:16ZXML Parsing<div><p>Haha so easy it was</p>
<pre>
<code> [Inject]
public var payload: XMLStatusEvent;
override public function execute():void {
trace ("lets do some parsy" + payload.xml);
}</code>
</pre>
<p>Sorted!</p></div>thomas.thorstenssontag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T13:38:29Z2011-05-26T13:38:29ZXML Parsing<div><p>Excellent! Yup - things are surprisingly easy in Robotlegs
usually :)</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/74676982011-05-26T14:23:05Z2011-05-26T14:23:05ZXML Parsing<div><p>Indeed a useful utility tool and now main weapon. Well , back to
work, !</p></div>thomas.thorstensson