cancel
Showing results for 
Search instead for 
Did you mean: 

xMII and recursion/DFS implementation?

Former Member
0 Kudos

Just a question for everyone...

is it possible to implement a depth first search algorithm in xMII..? The reason is to process an XML document which represents data in a tree format.

eg

<Hierarchy>

<Location/>

<Location/>

<Location/>

</Hierarchy>

(think of it as how windows explorer shows its folder listing... its a tree view and you can see subfolders as child nodes..)

and convert it to an xMII XML doc:

Hierarchy Location1 Location2 Location3

format...ie. I wanted to traverse the tree and flatten it into a table format.

ahh did this make sense?

I've been playing around with my XPath and Repeater blocks but I'm not making much headway.. Has anyone done something similar?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I am not sure on DFS but for a start lets assume you have an xml loader action to get the content of your xml file then to look inside each of the location(s) a correct XPath expression could be

XmlLoader_0.XmlContent{/Hierarchy/Location[1]}.

You can repeat it for Location[2] and so on.

or better still just repeat on /Hierarchy/Location. But I guess the problem would be if a particular <Location> have further child nodes and the child have further children and so on..

If you could post a sample xml that you are working on,it'll help.