Hi,
I have a page which receives xml from another web site, so I have no control over the xml. It is returning a list of Accounts. Specifically, QuickBooks accounts. These accounts can have children. However, there isn't a "has child" attribute, only a "has parent" attribute. In other words, if you look at an account you could tell that it had a parent, but you would have no idead if it had any children.
Here's an example of two accounts, one a child of the other.
The child:
<Account>
<Id idDomain="QB">288</Id>
<SyncToken>1</SyncToken>
<MetaData>
<CreatedBy>app</CreatedBy>
<CreatedById>1</CreatedById>
<CreateTime>2010-06-16T21:47:58.0Z</CreateTime>
<LastModifiedBy>app</LastModifiedBy>
<LastModifiedById>1</LastModifiedById>
<LastUpdatedTime>2010-06-16T21:47:58.0Z</LastUpdatedTime>
</MetaData>
<ExternalKey idDomain="QB">288</ExternalKey>
<Synchronized>true</Synchronized>
<Name>Property Tax Reserve</Name>
<AccountParentId idDomain="QB">272</AccountParentId>
<AccountParentName>Bank of the West - MMA</AccountParentName>
<Active>true</Active>
<Type>Asset</Type>
<Subtype>Bank</Subtype>
<CurrentBalance>0</CurrentBalance>
</Account>
The parent:
<Account>
<Id idDomain="QB">272</Id>
<SyncToken>1</SyncToken>
<MetaData>
<CreatedBy>app</CreatedBy>
<CreatedById>1</CreatedById>
<CreateTime>2009-03-19T21:34:22.0Z</CreateTime>
<LastModifiedBy>app</LastModifiedBy>
<LastModifiedById>1</LastModifiedById>
<LastUpdatedTime>2009-03-19T21:34:22.0Z</LastUpdatedTime>
</MetaData>
<ExternalKey idDomain="QB">272</ExternalKey>
<Synchronized>true</Synchronized>
<Name>Bank of the West - MMA</Name>
<Active>true</Active>
<Type>Asset</Type>
<Subtype>Bank</Subtype>
<CurrentBalance>4625.93</CurrentBalance>
</Account>
So in a list of a bunch of Accounts (in no particular order) how would I loop through to display them in a hierarchical fashion in ColdFusion?
Ex.
- Bank of the West - MMA
- Property Tax Reserve
- Parent Item
- child 1
- child 2
etc..