I have a large javascript object converted from XML. It has hierarchy, xml attributes (properties defined by an @attributename symbol) and xml values (properties defined by an #text symbol). So the following:
<parentnode length="5">
<childnode length="22" depth="45">This is a child node</childnode>
</parentnode>
creates an object that looks like this:
parentnode {
@length: "22"
childnode {
@depth: "45",
@text: "This is a child node"
}
}
and I want to create an HTML list that looks like this:
<ul>
<li data-length="22">parentnode
<ul>
<li data-depth="45">childnode: This is a child node</li>
</ul>
</li>
</ul>
I've tried various solutions, but none of them work for objects nested in objects with various data types.