i'm using Orbeon section templates in a common library that i use in multiple forms.
I need some values of a given section template to determine the visibility of some controls in other sections of my form. So i'm looking for a solution to parametrize the section template in order to never access its inner control values.
Can someone pls explain to me how to achieve that?
To refer to the value of a field which is inside a section template from a field outside of that section template (and itself not in another section template), you can't use the $field-name syntax. You can from inside the section template, but not from outside the section template. This is because section templates really encapsulate their content, thus allowing you, for instance, to have multiple instances of the same section template in your form, or multiple section templates using the same field names.
So, to answer your question, this is a case where you need to use a path expression. Say the field you want to refer to is named street and you named that particular instance of the template shipping, then you can refer to the value of the field with the expression /form/shipping/street. If you add another instance of that same template, and name that instance billing, then you could refer to that other street field as /form/billing/street.
Related
When creating a live template in WebStorm 2017.3.2 is there a way to apply multiple predefined functions on a single input? Or perhaps reference template variables from other template variables from within the same template?
Say for example I want to apply the capitalizeAndUnderscore function to $FOO$ and also apply the camelCase function to the same input supplied to the $FOO$ variable elsewhere in the template?
In other words, is it possible to achieve the following:
$FOO$: '$FOO_REFERENCE$' expands to MY_WHATEVER: 'myWhatever'
While only having to type mywhatever 1 single time?
Both capitalizeAndUnderscore() and camelCase() functions have String parameter - it can be a string constant, expression or a reference to already defined variable. So, you can easily use capitalizeAndUnderscore(FOO) as $FOO_REFERENCE$ value. But referencing variables defined in other templates is not supported. And you need to make sure that $FOO$ value is defined before being used.
In doxygen, there is the \copydoc (or #copydoc) command that allows to copy the documentation text of a link-object, which can point to a:
member (of a class, file or group), a class, a namespace, a group, a page, or a file
That's a nice feature and it works well, but I would like to copy the documentation of a template parameter from another class, but those don't have fully qualified names.
Is there any way to make that possible?
In this explanation, the following variables are used:
A: Page address
B: Page name
C: Category Name
D: Variable. Value is 'A'
T: Template
V: Variable
Using MediaWiki, the syntax for using a link is [[C/A|B]]. This creates a link to page A, which is inside category C, with text B. The syntax for using a template inside another template with a variable as an argument is {{T|{{{V|#}}}}} This produces the result of template T with variable V. Suppose this result is exactly A. Now, combining these approaches, I expect the code [[C/{{T|{{{V|#}}}}}|B]] to produce the same link as the link syntax example. However, the result is:
[[C/A|B]]
E.g. exactly the code that needs to be evaluated. Note how the template does get evaluated correctly, but the link is not parsed. It seems like I need to 'reverse' the priority some way.
Side note: My approach does work with just variables. E.g. if variable D were to hold the value A, the code [[C/{{{D|#}}}|B]] does produce the correct link. MediaWiki documentation is surprisingly sparse on the subject.
Hint: Wikipedia itself has a number of link templates that can be used as examples, however these form a complex interwoven web from which it is hard to interpret the correct notation for this particular case.
Questions:
How do I properly call a template inside of this context?
What about using the template result for other parts of the link,
such as the text?
What if this is a linked image or other special link?
Other things:
Preferrably, the solution should involve the use of only a single template if this is possible. If a 'dummy' link template containing a simple [[{{{1}}}]] is required, is there a default MediaWiki template that can do this, reducing clutter?
I want to recognize all of my servers over my office network. They have a particular naming pattern which only I use. I've defined it in a simpleType.
Now I was told I have to filter my servers from a list of full DNS names (like www.bla.moo.oneofmyservers.foo.loo). My naming strategy has a length limit. I would have simply put it inside a *mystrategy* if not for that.
Is there a way to reference my type from within a pattern definition?
It didn't work when I wrote *mytype*.
Assuming that what you're asking is something like this:
I have a pattern and I've used it as a constraining facet in a simple type; now, I want to make another type, and for maintenance purposes, I wish to somehow reference that pattern, so that I don't have to maintain it in two different places...
The answer is no, you can't. Constraining facets in XSD are not referenceable entities; nor types are referenceable within constraining facets.
The Visual Studio autoexp.dat syntax allows you to display ‘the name of the most-derived type of the object’ with the 'special format' <,t>, which is very helpful if you have lots of derived types. From the syntax, I assumed that you could do the same thing for members, such as <member,t>, but when I try that the preview only shows ???
Are there ways to display the name of a member’s type in the preview?
I’d like to be able to do it in the [autoexpand] section, and also in the [visualizer] section (for different objects of course).
I have found a way to do it, but it's not a very elegant solution:
Write an [AutoExpand] entry for the member type which includes the <,t> directive. Then when you display the member with <member> it will show the same information as it does for the member type on its own, including its type name.
It's not a great solution, because I don't really want to have to dispay the type information every time when the member type appears on its own, but it does give me the information I was after.