Greetings!
I have an XML document which I've simplified to the snippet below. It lists different versions of different classes, and then what the currently selected version of each class is. There is an associated schema (also left out for simplicity) that enforces a composite relationship between the classes and current classes (such that the current class is always a valid combination of clsid and version as defined in the classes branch).
In the ui for this (I'm using Altova Stylevision if that makes any difference) I have 2 combo boxes to let the user define the current version of each class. When a particular clsid is selected in the first combo box, I want to filter the versions available in the second combo box so that only versions for the selected class are visible (e.g. if you select CLSID_ClassB you get versions 3 and 4). I can seed the combo boxes by either hard coding a list (which is out of the question), or by specifying an XPath expression.
My question is essentially what is the XPath expression I need? With the context node starting at /myRoot/currentClasses/cla
ss[1] for example, the expression should look something like:
../../classes/class[@clsid
= 'CLSID_ClassA']/@version
The problem with this is that CLSID_ClassA is hardcoded, but I don't want it to be. I basically want to preserve the context node where the expression processing starts, and reference it later in the predicate like this:
../../classes/class[@clsid
= <the original node>/@clsid]/@version
Is it possible to do this using XPath syntax?
Thanks!
Start Free Trial