hello, I have a difficulty achieving the results I need and I hope that someone here can help me
I have an xml like this
I need to group the products both by brand AND feature. That means that the result should look like this:
Any help would be very welcome....
I have an xml like this
Code:
<products>
<Product>
<ID>1</ID>
<Brand>brand1</Brand>
<Features>
<Feature>feature1</Feature>
<Feature>feature2</Feature>
<Feature>feature3</Feature>
</Features>
</Product>
<Product>
<ID>2</ID>
<Brand>brand1</Brand>
<Features>
<Feature>feature2</Feature>
<Feature>feature3</Feature>
</Features>
</Product>
<Product>
<ID>3</ID>
<Brand>brand2</Brand>
<Features>
<Feature>feature1</Feature>
<Feature>feature2</Feature>
</Features>
</Product>
</products>
Code:
<groups>
<group>
<Brand>1</Brand>
<Feature>feature1</feature>
<Product>1</Product>
</group>
<group>
<Brand>1</Brand>
<Feature>feature2</Feature>
<Product>1</Product>
<Product>2</Product>
</group>
<group>
<Brand>1</Brand>
<Feature>feature3</Feature>
<Product>1</Product>
<Product>2</Product>
</group>
<group>
<Brand>2</Brand>
<Feature>feature1</Feature>
<Product>3</Product>
</group>
<group>
<Brand>2</Brand>
<Feature>feature2</Feature>
<Product>3</Product>
</group>
</groups>
Comment