Hi All,
I would like some help on counting the number of products in a particular category with a quantity greater than 0 using the following XML file
HTML Code:
<?xml version="1.0"?>
<Company xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Products>
<Product>
<Id>5241</Id>
<Sku>02854U</Sku>
<Barcode />
<Name>PDRAG</Name>
<QtyInStock>1</QtyInStock>
<Attributes>
<Attribute>
<Name>Current Stock</Name>
<Value>Yes</Value>
</Attribute>
<Attribute>
<Name>Amber Stock</Name>
<Value><NONE></Value>
</Attribute>
<Attribute>
<Name>Warehouse Name</Name>
<Value><NONE></Value>
</Attribute>
</Attributes>
</Product>
</Products>
</Company>
I can count the number of products in the Current Stock category using this:
Code:
count(Company/Products/Product/Attributes/Attribute[Name='Current Stock' and Value='Yes'])
and also the number of products with a quantity greater than 0 using this:
Code:
count(Company/Products/Product[QtyInStock > 0])
but how do i can combine the two??
thanks in advance
jonnyuk3