Is it possible to use a variable in input xpath (or any xpath) in input form?








Is it possible to use a variable in an xpath in Input Forms?


Something like this? (I know this exact thing won't work, but just to illustrate)



<!-- Something that would result in the xpath reading e.g. "parameters/keywords/@second_keyword" -->
<input label="Keyword" xpath="'parameters/keywords/@' + [/tmp/@keywordNumber] + '_keyword'"/>




Fore example / More elaborate explanation..:

If I have this in a data schema:



<srcSchema ...>
    <element label="Parameters" name="parameters">
      <element label="Keywords" name="keywords">
        <attribute dbEnum="xtk:enum:first_keyword" label="First Keyword" length="50" 
                   name="first_keyword" pkgStatus="always" type="string" xml="true"/>
        <attribute dbEnum="xtk:enum:second_keyword" label="Second Keyword" length="50" 
                   name="second_keyword" pkgStatus="always" type="string" xml="true"/>
        <attribute dbEnum="xtk:enum:third_keyword" label="Third Keyword" length="50" 
                   name="third_keyword" pkgStatus="always" type="string" xml="true"/>




And let's say this in an external delivery input form:



<form ... >
    <!-- Variable that can contain "first", "second" or "third" -->
    <set value="second" xpath="/tmp/@keywordNumber"/>

    <container ... >
        <!-- Showing currently the enum list (hard coded) called "first_keyword", but I want "first" not to be hard coded -->
        <input label="Keyword" xpath="parameters/keywords/@first_keyword"/>




Is there a simple ish way of using e.g. /tmp/@keyword in the input xpath instead of "first", "second" or "third" being hard coded?

So I hope there's something like this existing: (Again, I know this below does not work, but hope you get the idea of what I want to achieve)



<!-- Something that would result in the xpath reading "parameters/keywords/@second_keyword" -->
<input label="Keyword" xpath="'parameters/keywords/@' + [/tmp/@keywordNumber] + '_keyword'"/>




I've also looked into xpath-valuesxpathLinkxpathExpr, xpathEnum, and a few others, but not sure how they work...

Would really appreciate if anyone here knows if this really is doable and how!

Accepted Solutions (0)

Answers (0)