I have a multilevel structure that looks like that :
a = structNew()
a.a.a.a = apple
a.a.a.b = banana
a.a.b.a = potato
a.b = beef
What would be the best way of converting that structure in an
XML document that would look like the following attached code ?
Any suggestion ? The structure isn't always 4-levels deep.
Sometimes it can be 3, 4, 8, 2...
I thought I would just loop recursively over my structure :
calling a method that would check if the item is a struct and if so
create a new XML node inside the XML node being processed or else
just put the value in node currently being open, then return the
result back to the calling method... and so on.
Is there any sort of code snippet that may convert a
multilevel structure to an XML document ? All examples I've found
so far only deals with one level.
For our purpose we had to deal with orderlines and some form
structure up to 8 levels deep. If your structures names are all
uniques, you can remove the part in the CFC that checks for the
iteration indicator (___i) in a structure name.