XPath is the basic language to query information from an XML-file. It offer the possibility to address all fragments inside an XML-instance for comparing it with the rules in the dci instance.
Find all cc elements within the current context:
./sw-unit
Note that this is equivalent to:
sw-unit
Find the root element (msrsw) of this document
/msrsw
Find all sw-unit elements anywhere within the current document:
//sw-unit
Find all sw-units where the value of the <si-unit> attribute [mass-expo] = 1
//sw-unit/si-unit[@mass-expo = "1"]
find all Si-units, where at least one of the attributes (lenght-expo to amount-of-substance-expo) are defined:
//si-unit[@length-expo || @time-expo || @mass-expo || @electric-current-expo || @thermodynamic-temperature-expo || @luminous-intensity-expo || @amount-of-substance-expo]
Find all <short-name> elements within an <sw-unit> element. Note that the <sw-unit> children of the current context are found, and then <short-name> children are found relative to the context of the <sw-unit> elements.
sw-unit/short-name
Find all <short-name> elements, one or more levels deep in the <sw-data-dictionary-spec> (arbitrary descendants):
sw-data-dictionary-spec//short-name
Note that this is different from the following pattern, which finds all short-name elements that are grandchildren of sw-data-dictionary elements:
sw-data-dictionary-spec/*/spec
Find all< long-name>s, one or more levels deep in the current context. Note that this situation is essentially the only one where the period notation is required:
.//long-name
Find all element children of <sw-unit> elements:
sw-unit/*