Depending on what exactly you mean by "imported". If this is XML that you
are loading from a server directly into your app and have zero control over
the format and you are the consumer of it, then perhaps your best approach
is to simply work with what you get. You could write a transform class that
basically parses the XML and then creates a new XML with your desired
structure but I wouldn't necessarily jump through hoops unless the payoff
was really huge.

If on the other hand someone is handing you an XML file and you are just
going to place it on your server and then load and parse it at runtime then
you have several options. If this is a one shot deal I might consider doing
it manually. If this is going to be a regular occurrence where the XML will
need to be updated fairly frequently then I would consider writing an XSLT
transform. XSLT might be a pain to write the first time, but once done can
take the process of transforming the XML in a matter of a few milliseconds.
You can use ANT to execute the XSLT on the XML.

If you have any type of server-side experience you can also apply the XSLT
server-side even if you don't have access to the original XML generation.
You could write a server side method that is in essence a proxy - the method
calls the original server method to generate the XML, then your method would
automatically apply the transform and send back the transformed XML. How you
would approach this methodology would really depend on your server
technology. There should be a number of examples of "proxy methods" out
there for Flash users that were/are used to allow Flash to access a method
on an external server by calling a method on the local server. This would be
the same thing, except maybe just proxing a local method and applying XSLT
to it.

There are always a number of methods to wind up at the same end result. If
you could provide more detail on what your exact situation is, it would be
easier to give you some advise. 

Sincerely
Mark R. Jonkman

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Lehr,
Theodore
Sent: Thursday, March 25, 2010 2:24 PM
To: Flash Coders List
Subject: [Flashcoders] xml to xml

So I am getting some xml imported that is not formed as I would like - is it
possible to parse it into xml that is formed how I would like it to be?

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to