This file identifies all XPath queries used across the system’s XSLT stylesheets to handle data calculation, filtering, and display.
These queries are used to calculate the high-level metrics shown in the summary cards.
-
Total Item Count
count(//inventory:item)Calculates the total number of items in the database. -
Available Stock Count
count(//inventory:item[inventory:status='Available'])Filters and counts only items marked as "Available". -
Low Stock Count
count(//inventory:item[inventory:status='Low Stock'])Filters and counts items that are running low on inventory. -
Out of Stock Count
count(//inventory:item[inventory:status='Out of Stock'])Filters and counts items with zero quantity remaining.
These queries work together to group items by their category and provide sub-totals.
-
Unique Category Filter
//inventory:item[not(@category = preceding::inventory:item/@category)]Identifies every unique category name by skipping duplicates. -
Category Name Retrieval
@categoryPulls the specific name of the category currently being processed. -
Items Per Category Count
count(//inventory:item[@category = $currentCategory])Counts how many items belong to the specific category stored in the variable.
These queries are used to populate the main inventory list with specific item details.
-
Main Table Iteration
//inventory:itemTargets all item nodes to create a repeating list of rows. -
Item Identity
@idRetrieves the unique ID attribute for the item. -
Item Details
inventory:nameRetrieves the name of the equipment. -
Stock Level
inventory:quantityRetrieves the numerical count of the item. -
Item Status
inventory:statusRetrieves the availability label for the item. -
Update Timestamp
inventory:last_updateRetrieves the date the record was last modified.