Smart edit in xstl stylesheets based on schema components
Posted: Sat Oct 04, 2014 11:14 am
Hi,
on of the great features of Oxygen is smart edit within xslt scripts based on the structure of document instances.
Lets say i have a document instance with root element a and childs b and c. Then, for a template that matches /a, the xslt editor will suggest childs b and c in apply-template rules, for example.
This will happen if i have defined a scenarion for the stylesheet which references the document instance as input.
I understand, that the knowledge "b and c are legal childs of a" has been learned from the structure of the document instance of the scenario.
I would expect that the same would happen when my script imports a schema and has template rules defined for schema components. For the example given above, this would be
Observations:
Sincerly,
Frank
on of the great features of Oxygen is smart edit within xslt scripts based on the structure of document instances.
Lets say i have a document instance with root element a and childs b and c. Then, for a template that matches /a, the xslt editor will suggest childs b and c in apply-template rules, for example.
This will happen if i have defined a scenarion for the stylesheet which references the document instance as input.
I understand, that the knowledge "b and c are legal childs of a" has been learned from the structure of the document instance of the scenario.
I would expect that the same would happen when my script imports a schema and has template rules defined for schema components. For the example given above, this would be
Code: Select all
<xsl:import-schema schema-location="schema.xsd"/>
<xsl:template match="schema-element(a)">
<xsl:value-of select="b"></xsl:value-of>
</xsl:template>
- there is no smart edit when i match schema-element(a), although the scenario has not changed. Neither b nor c whill show up as suggestions in the value-of expression. Its kind of a regression compared to the non-schema-aware version.
- when i switch back to match='a' again, smart edit behaves like before. This is the case even if the schema defines an optional child d for root element a. Since this is not in the document instance, this optional element d does not show up as a suggestion in the template rule for a.
- match='schema-element(E)'
- match='element(*, T)'
Sincerly,
Frank