Contents   Index   Previous   Next



Special page groupings (filters)

 

Special page groupings do not access all nodes of an XML file but only a filtered amount of nodes. In addition, special page groupings can contain especially specified node sets.

 

All limitations are written in brackets [] behind the node name. The content of a limitation is a valid XPath expression, which returns TRUE or FALSE.

 

Examples:

 

• All product groups which are not empty and therefore contain products:
ProductGroup[count (Product) > 0]

 

• All product groups whose product group id starts with 2204:
ProductGroup[starts-with(ProductGroup, '2204')]

 

• All product groups with a product group ID between 20 and 30:
ProductGroup[ProductGroupID<=20 and ProductGroupID>=30]

 

• All products supposed to be for sales should be displayed:
Product[IsForSales='Y']

 

In these filters not only elements of the XML file can be used; in complex layouts very often variables are used.

 

Example:

 

• Variable $MarkName is defined as "Audi" – This means that only products whose manufacturer is "Audi" should be displayed:
Product [ManufacturerName=$MarkName]

 

As the XPath expressions for the filtering can be rather complex, it is important for the user to know which elements of the XML file he can access from where (so he should use relative paths) and which XPath functions he can use with what syntax.

 

Special node sets address from one place inside the XML tree to another place. For the page grouping this is not very important.