Here is an example of the XML input file I will receive: Note: The example is fictious but illustrates the point
Note: The flat structure is something I can't change
Note: Hopefully not too many typos since I am making this up
<OrderData>
<Vendor>
<ID>1</ID>
<Name>Vendor X</Name>
</Vendor>
<Vendor>
<ID>2</ID>
<Name>Vendor Y</Name>
</Vendor>
...
<Product>
<ID>1</ID>
<Name>Product X</Name>
<VendorID>1</VendorID>
</Product>
...
<Order>
<ID>1</ID>
<OrderItem>
<ProductID>1</ProductID>
<Quantity>10</Quantity>
</OrderItem>
<OrderItem>
<ProductID>2</ProductID>
<Quantity>12</Quantity>
</OrderItem>
...
</Order>
...
</OrderData>
How could I use XSL to list all the order IDs grouped for each vendor? That is, iterate through each vendors/products then scan each OrderItem to see if the order includes a product made by that vendor.
It looks like a nested for-each each with the node set being the root. But, can I do that? Can the inside for-each of a nested set process a node set that is larger than the current node set?
Thanks,
Mark (XML/XSL Newbie)
Note: The flat structure is something I can't change
Note: Hopefully not too many typos since I am making this up
<OrderData>
<Vendor>
<ID>1</ID>
<Name>Vendor X</Name>
</Vendor>
<Vendor>
<ID>2</ID>
<Name>Vendor Y</Name>
</Vendor>
...
<Product>
<ID>1</ID>
<Name>Product X</Name>
<VendorID>1</VendorID>
</Product>
...
<Order>
<ID>1</ID>
<OrderItem>
<ProductID>1</ProductID>
<Quantity>10</Quantity>
</OrderItem>
<OrderItem>
<ProductID>2</ProductID>
<Quantity>12</Quantity>
</OrderItem>
...
</Order>
...
</OrderData>
How could I use XSL to list all the order IDs grouped for each vendor? That is, iterate through each vendors/products then scan each OrderItem to see if the order includes a product made by that vendor.
It looks like a nested for-each each with the node set being the root. But, can I do that? Can the inside for-each of a nested set process a node set that is larger than the current node set?
Thanks,
Mark (XML/XSL Newbie)