Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-incubator-dev] StylesheetModel question

DOUG SATCHWELL wrote:
Also, just to clarify the model a little bit, the Stylesheet class is a representation of a stylesheet, so its imports and includes are the ones declared in that stylesheet.
The StylesheetModel class, however, is a representation of the composed stylesheet i.e. its includes, imports, templates etc. are the sum of all such things in the stylesheet and all its included stylesheets. Its a bit like the distinction between .java files and .class files in the JDT.
I say this because one of the bugs mentions adding xsl:param to the model. To do this we would need to add:
public List<Param> getParams()
to the Stylesheet class (where Param is a new class). But the StylesheetModel interface would not change; its just that the Param's would get added to the list of global variables. Its a subtle distinction, but an important one.
Yeah, I figured something would need to be added, but from a model standpoint a getGlobalVariables() which returns all the global variables defined regardless of which stylesheet they were defined in is important. Having that include xsl:params at the Model Level along with xsl:variables makes it easier to work with some content assistance. The situation is this:

Stylesheet A imports, B, C, and D.

Stylesheet D defines a global parameter variable, and stylesheet A wants to use it. As you know there is no distinction between a variable that is a parameter or a xsl:variable they both are accessed via $whatever in the code. So content assistance should be able to return in one call all the variables that are in scope defined by A, B, C , and D. Currently it only looks at the local stylesheet, which is limiting when you have multiple stylesheets that include and import each other. For variables, that are defined in other stylesheets, information would be displayed in the Additional Info box to say where it was defined.

I agree that we will probably need to add xsl:param into the stylesheet element. Anways, as I'm working on the content assistance, I'll see about adding some additional functionality where it makes things easier.




Back to the top